OFFSET
1,5
COMMENTS
Conjecture: a(n) > 0 for any n > 4. In other words, for any prime p > 7, there exists a right triangle whose three sides are among 1,...,p-1 and whose area is a primitive root modulo p.
We have verified this for primes p < 10^5.
We also conjecture that for any prime p > 31, there exists a right triangle whose three sides are among 1,...,p-1, and whose perimeter and area are quadratic residues modulo p.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 5 since 3^2 + 4^2 = 5^2, and (3*4)/2 = 6 is a primitive root modulo prime(7) = 17.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
Dv[n_]:=Divisors[Prime[n]-1]
Do[Do[Do[If[SQ[k^2-j^2]==False, Goto[cc]]; Do[If[Mod[(j*Sqrt[k^2-j^2]/2)^(Part[Dv[n], t]), Prime[n]]==1, Goto[cc]]; Continue, {t, 1, Length[Dv[n]]-1}];
Print[n, " ", k]; Goto[aa]; Label[cc]; Continue, {j, 1, k-1}]; Label[dd]; Continue, {k, 1, Prime[n]-1}]; Print[n, " ", 0]; Label[aa]; Continue, {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Aug 06 2015
STATUS
approved