Let a be a prime of the form (2n+1), and let b be a prime of the form (2a+1), such that 1/b has an even period of length 2a, i.e. 0 followed by 2a decimal digits.
The 'splitadd' function splits these 2a digits into equal halves and adds them.
To give an (imaginary) example, say 1/b was 0.0123456789, then 'splitadd' would produce 01234+56789, and add these for a value of 58023.
Show that the result of the 'splitadd' function is always (10^a-1), or find a counterexample.
I've been mulling over this problem and I seem to come down to a core idea:
What is 10^a mod b?
By Fermat's Little Theorem we can say 10^(2a)-1 = 10^(b-1) - 1 = 0 mod b. But what about 10^a-1 mod b? From the previous equation its easy to see that the congruence is either 1 or -1.
So I did a bit of research. In this problem, b is a prime of the form 4n+3. What I found is that its always the case that for any A coprime to P and P is a prime of the form 4k+3 then A^(2k+1) = A^((P-1)/2) = -1 mod P.
Also, similarly when P is a prime of the form 4k+1 then A^(2k+1) = A^((P-1)/2) = 1 mod P.
Proofs typically invoke quadratic residues, of which I am not that well versed.
So then the answer to my core question is 10^a mod b = -1
https://math.stackexchange.com/questions/502089/prove-that-ap-1-2-equiv-1-mod-p-and-ap-1-2-equiv-1-pmod-p