OFFSET
2,7
COMMENTS
If q is not a power of 2, then a(n) is the number of pairs of consecutive nonzero squares in the finite field F_q. In other words, a(n) is the number of solutions to x^((q-1)/2) = (x+1)^((q-1)/2) = 1 in F_q. This can be proved by generalizing the argument of Jack D'Aurizio to the Math Stack Exchange question "Existence of Consecutive Quadratic residues" to the case of F_q.
LINKS
Jianing Song, Table of n, a(n) for n = 2..10000
Math Stack Exchange, Existence of Consecutive Quadratic residues.
EXAMPLE
a(5) = 1 because there is one pair of consecutive nonzero squares in the finite field F_q with q = A246655(5) = 7, namely {1, 2}.
a(7) = 1 because there is one pair of consecutive nonzero squares in the finite field F_q with q = A246655(7) = 9, namely {1, 2} (note that 2 = -1 = i^2 in F_9 = F_3(i)).
PROG
(PARI) lim_A366502(N) = for(n=3, N, if(isprimepower(n), print1((n - kronecker(-4, n))/4 - 1, ", ")))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, Oct 12 2023
STATUS
approved