OFFSET
1,1
COMMENTS
Positions where a(n) = a(n+1) = a(n+2) = a(n+3) are for example n=737 and n=1262. - R. J. Mathar, Nov 17 2009
EXAMPLE
When n=4, prime(4) = 7, and a(4) is the smallest prime above 7 with quadratic residue 7.
This yields a(4)= 19 because 8^2 = 7 (mod 19) and 19 > 7. The intermediate candidates 11, 13 and 17 fail the test.
MAPLE
A166980 := proc(n) local p, q, i ; q := ithprime(n) ; for i from 1 do p := ithprime(i) ; if numtheory[legendre](q, p) = 1 and p>q then return p; end if; od: end proc;
seq(A166980(n), n=1..80) ; # R. J. Mathar, Nov 02 2009
PROG
(PARI) A166980(n) = { local(q=prime(n), p=nextprime(q+1)) ; while( kronecker(q, p)!=1, p=nextprime(p+1) ; ) ; return(p) ; } { print(vector(80, n, A166980(n))); } /* R. J. Mathar, Nov 02 2009 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
J. M. Bergot, Oct 26 2009
EXTENSIONS
Some values corrected and definition clarified by R. J. Mathar, Nov 02 2009
STATUS
approved