A number a is n-good if it can be written as r+bn where 0<r<n and gcd(r,n)=1, gcd(b,n)=1. Find the size of the set of distinct remainders mod 3200 of perfect squares which are 3100-good. In other words, find {a2mod3200∣a2 is 3100-good}. Format for answering: If this quantity is expressed in the form of a×bk, find a+b+k.
Solution
Answer:203 (the quantity is 2×3198)
First count the square residues modulo 3100 that are coprime to 3. There are φ(3100)=2⋅399 coprime residues. Two such numbers have the same square precisely when they are congruent up to sign modulo 3100, giving 399 distinct square residues.
If a2≡r(mod3100) and 3∤a, then
(a+k⋅3100)2≡a2+2ak⋅3100(mod3200).
Because 2a is coprime to 3100, varying k covers every possible upper residue. For each r, exactly φ(3100)=2⋅399 of these are 3100-good. Thus the size is 399⋅2⋅399=2⋅3198, and a+b+k=2+3+198=203. This lifting argument is also related to Hensel’s lemma.