OFFSET
1,5
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 25. In other words, for any prime p > 100, we have a^2 + b^2 = c^2 for some a,b,c in the set R(p) = {0<r<p: r is a quadratic residue mod p}.
(ii) For any prime p > 50, we have a^2 + b^2 = c^2 for some a,b,c in the set N(p) = {0<n<p: n is a quadratic nonresidue mod p}.
(iii) For any prime p > 32, we have a^2 + b^2 = c^2 for some a,b in the set R(p) and c in the set N(p).
(iv) For any prime p > 72, we have a^2 + b^2 = c^2 for some a,b in the set N(p) and c in the set R(p).
I have verified the conjecture for primes p < 1.5*10^7.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(10) = 25 since 7^2 + 24^2 = 25^2, and 7, 24, 25 are all quadratic residues modulo prime(10) = 29.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
Do[Do[If[JacobiSymbol[k, Prime[n]]<1, Goto[bb]]; Do[If[JacobiSymbol[j, Prime[n]]<1, Goto[cc]];
If[SQ[k^2-j^2]&&JacobiSymbol[Sqrt[k^2-j^2], Prime[n]]==1, Print[n, " ", k]; Goto[aa]]; Label[cc]; Continue, {j, 1, k-1}]; Label[bb]; Continue, {k, 1, Prime[n]-1}];
Print[n, " ", 0]; Label[aa]; Continue, {n, 1, 50}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Aug 03 2015
STATUS
approved