A121842 Difference between n^3 and next prime.
2, 1, 3, 2, 3, 2, 7, 4, 9, 4, 9, 30, 5, 6, 5, 14, 3, 6, 7, 4, 9, 16, 3, 30, 5, 4, 3, 4, 9, 2, 11, 12, 3, 14, 9, 24, 7, 18, 5, 14, 7, 6, 5, 24, 9, 2, 31, 14, 5, 10, 3, 10, 3, 14, 13, 18, 5, 28, 9, 12, 23, 10, 3, 2, 3, 2, 5, 16, 9, 2, 19, 2, 25, 6, 3, 16, 3, 6, 5, 4, 9, 16, 13, 2, 19, 4, 3, 4, 9, 14
Offset: 0
Examples
a(6)=7 because next prime after 6^3=216 is 223 and 223-216=7.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
- A. E. Ingham, On the difference between consecutive primes. Quarterly Journal of Mathematics. Oxford Series. 8 (1) (1937) p. 255-266 (doi:10.1093/qmath/os-8.1.255).
Crossrefs
Cf. A060199 (number of primes between consecutive cubes).
Programs
-
Mathematica
Array[NextPrime[#] - # &[#^3] &, 90, 0] (* Michael De Vlieger, Nov 12 2020 *)
-
PARI
a(n) = nextprime(n^3) - n^3; \\ Michel Marcus, Oct 10 2013
Comments