OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
p(3)=5, 5^4 = 625; for odd k and n > 1, p(n)^r - k is even and thus not prime, so we only need consider even k.
for k = 2: 625 - 2 = 623, which is 7 * 89 and not prime.
for k = 4: 625 - 4 = 621, which is 3^3 * 23, also not prime.
for k = 6: 625 - 6 = 619, which is prime, so 6 is the smallest number that can be subtracted from 625 to make another prime.
Hence a(3) = 6.
MATHEMATICA
sk[p_]:=Module[{k=1, c=p^4}, While[CompositeQ[c-k], k++]; k]; sk/@Prime[Range[100]] (* Harvey P. Dale, Nov 19 2023 *)
Table[With[{c=p^4}, c-NextPrime[c, -1]], {p, Prime[Range[100]]}] (* Harvey P. Dale, Nov 20 2023 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Carl R. White, Sep 14 2007
STATUS
approved