OFFSET
1,2
COMMENTS
Numbers n such that (smallest prime > n)- n = (smallest prime > n^2)- n^2.
Primes in the sequence are: 2, 3, 7, 13, 31, 37, 61, 67, 97, 103, 131, 151, 163, 181, 193,...
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
1 is in the sequence because the distance from 1 to 2 is the same as the distance from 1^2 to 2.
2 is in the sequence because the distance from 2 to 3 is the same as the distance from 2^2 to 5.
3 is in the sequence because the distance from 3 to 5 is the same as the distance from 3^2 to 11.
MATHEMATICA
Select[Range[235], NextPrime[#] - # == NextPrime[#^2] - #^2 &] (* Giovanni Resta, Jun 09 2013 *)
PROG
(PARI) is(n)=nextprime(n+1)-n==nextprime(n^2)-n^2 \\ Charles R Greathouse IV, Jun 14 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerasimov Sergey, Jun 05 2013
EXTENSIONS
Corrected by Giovanni Resta, Jun 09 2013
STATUS
approved