login
Number of solutions of a^2 + b^2 congruent to -1 modulo the n-th prime.
1

%I #27 Dec 13 2015 01:27:49

%S 0,1,1,1,2,2,3,3,3,4,4,5,6,6,6,7,8,8,9,9,10,10,11,12,13,13,13,14,14,

%T 15,16,17,18,18,19,19,20,21,21,22,23,23,24,25,25,25,27,28,29,29,30,30,

%U 31,32,33,33,34,34,35,36,36,37,39,39,40,40,42,43,44,44

%N Number of solutions of a^2 + b^2 congruent to -1 modulo the n-th prime.

%C 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).

%C Is this sequence nondecreasing? The data for the first thousand terms supports this conjecture.

%H MathOverflow, <a href="https://mathoverflow.net/questions/171602/how-does-this-sequence-grow">How does this sequence grow</a>

%F See the answer given in the link above.

%F For n>1, a(n) = ceiling(p(n)/8), where p(n) is the n-th prime.

%e 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).

%p A242736:=n->ceil(ithprime(n)/8): 0,seq(A242736(n), n=2..100); # _Wesley Ivan Hurt_, Dec 12 2015

%t iend=50;

%t For[n=1,n<=iend,n++,

%t p=Prime[n];

%t count[n]=0;

%t For[i=0,i<=(p-1)/2,i++,

%t For[j=i,j<=(p-1)/2,j++,

%t If[Mod[i^2+j^2,p]==p-1,count[n]++;]]]]

%t Print[Table[count[i],{i,1,iend}]]

%K nonn,easy

%O 1,5

%A _David S. Newman_, May 21 2014

%E More terms from _Alois P. Heinz_, Jun 17 2014