OFFSET
1,5
COMMENTS
a(n) is the number of solutions of a^2 + b^2 congruent to -1 modulo the n-th prime, where 0 <= a <= b <= floor((p-1)/2).
Is this sequence nondecreasing? The data for the first thousand terms supports this conjecture.
LINKS
MathOverflow, How does this sequence grow
FORMULA
See the answer given in the link above.
For n>1, a(n) = ceiling(p(n)/8), where p(n) is the n-th prime.
EXAMPLE
For n=5: The 5th prime is 11. 1^2 + 3^2 = 10 is congruent to -1 (mod 11) and 4^2 + 4^2 = 32 is congruent to -1 (mod 11).
MAPLE
MATHEMATICA
iend=50;
For[n=1, n<=iend, n++,
p=Prime[n];
count[n]=0;
For[i=0, i<=(p-1)/2, i++,
For[j=i, j<=(p-1)/2, j++,
If[Mod[i^2+j^2, p]==p-1, count[n]++; ]]]]
Print[Table[count[i], {i, 1, iend}]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David S. Newman, May 21 2014
EXTENSIONS
More terms from Alois P. Heinz, Jun 17 2014
STATUS
approved