login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A133518
Smallest k such that p(n)^3 + k is prime where p(n) is the n-th prime.
8
3, 2, 2, 4, 30, 6, 6, 4, 30, 2, 12, 18, 6, 24, 14, 14, 12, 10, 16, 2, 6, 4, 2, 14, 54, 6, 4, 18, 4, 2, 30, 26, 56, 10, 24, 12, 24, 10, 30, 2, 18, 6, 26, 24, 14, 28, 18, 10, 14, 10, 12, 24, 16, 6, 18, 2, 20, 6, 4, 12, 4, 6, 10, 2, 6, 14, 16, 4, 18, 10, 14, 14, 16, 24, 4, 12, 32, 16, 50, 12, 2
OFFSET
1,1
LINKS
EXAMPLE
p(1)=2, 2^3 = 8. for even k, 2^r + k is even and thus not prime, so we only need consider odd k.
for k = 1: 8 + 1 = 9, which is 3^2 and not prime.
for k = 3: 8 + 3 = 11, which is prime, so 3 is the smallest number that can be added to 8 to make a new prime.
Hence a(1) = 3.
MATHEMATICA
Table[NextPrime[Prime[n]^3] - Prime[n]^3, {n, 100}] (* Bruno Berselli, Sep 03 2013 *)
PROG
(PARI) a(n) = {k = 0; p3 = prime(n)^3; while (! isprime(p3+k), k++); k; } \\ Michel Marcus, Sep 03 2013
(PARI) a(n) = {p3 = prime(n)^3; nextprime(p3) - p3; } \\ Michel Marcus, Sep 03 2013
(Magma) [NextPrime(p^3)-p^3: p in PrimesUpTo(500)]; // Bruno Berselli, Sep 03 2013
KEYWORD
nonn,easy
AUTHOR
Carl R. White, Sep 14 2007
STATUS
approved