%I #10 Aug 04 2015 04:30:42
%S 0,0,0,0,5,0,0,0,0,25,0,34,0,41,25,25,5,5,26,5,37,0,41,0,0,65,17,34,5,
%T 61,17,5,17,25,25,29,37,26,25,41,5,5,5,25,25,53,34,17,34,5,109,5,5,5,
%U 17,37,34,41,34,53
%N Least positive integer k < prime(n) such that there are 0 < i < j < k for which i^2 + j^2 = k^2 and i,j,k are all quadratic residues modulo prime(n), or 0 if no such k exists.
%C 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}.
%C (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}.
%C (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).
%C (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).
%C I have verified the conjecture for primes p < 1.5*10^7.
%H Zhi-Wei Sun, <a href="/A260911/b260911.txt">Table of n, a(n) for n = 1..10000</a>
%e a(10) = 25 since 7^2 + 24^2 = 25^2, and 7, 24, 25 are all quadratic residues modulo prime(10) = 29.
%t SQ[n_]:=IntegerQ[Sqrt[n]]
%t Do[Do[If[JacobiSymbol[k,Prime[n]]<1,Goto[bb]];Do[If[JacobiSymbol[j,Prime[n]]<1,Goto[cc]];
%t 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}];
%t Print[n," ",0];Label[aa];Continue,{n,1,50}]
%Y Cf. A000040, A000290, A257364.
%K nonn
%O 1,5
%A _Zhi-Wei Sun_, Aug 03 2015
|