cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A226381 Numbers n such that the distance from n to the next prime is the same as the distance from n^2 to the next prime.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 10, 13, 15, 16, 21, 31, 36, 37, 38, 39, 40, 45, 48, 50, 57, 61, 64, 66, 67, 76, 81, 85, 91, 97, 99, 103, 105, 111, 126, 130, 131, 141, 147, 150, 151, 154, 156, 163, 168, 171, 180, 181, 185, 193, 202, 207, 210, 216, 225, 235, 237, 240, 246, 248, 249, 250, 253
Offset: 1

Views

Author

Gerasimov Sergey, Jun 05 2013

Keywords

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,...

Examples

			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.
		

Programs

  • Mathematica
    Select[Range[235], NextPrime[#] - # == NextPrime[#^2] - #^2 &] (* Giovanni Resta, Jun 09 2013 *)
  • PARI
    is(n)=nextprime(n+1)-n==nextprime(n^2)-n^2 \\ Charles R Greathouse IV, Jun 14 2013

Formula

{n: A013632(n) = A013632(n^2)}. - R. J. Mathar, Jun 09 2013

Extensions

Corrected by Giovanni Resta, Jun 09 2013