OFFSET
1,1
COMMENTS
a(n) = 0 for n = {6, 7, 8, 9, 12, 14, 20, 23, 25, ...} because for k large enough, k^n-(k-1)^n-...-3^n-2^n < 0. Thus, no number will be prime.
See A240083 for the n-values with nonzero entries.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
2^2 = 4 is not prime. 3^2-2^2 = 5 is prime. Thus, a(2) = 3.
2^3 = 8 is not prime. 3^3-2^3 = 19 is prime. Thus, a(3) = 3.
MAPLE
f:= proc(n) local x, r, k;
r:= 0; x:= 2^n;
for k from 3 do
r:= r + (k-1)^n;
x:= k^n - r;
if x < 2 then return 0 fi;
if isprime(x) then return k fi;
od
end proc:
f(1):= 2:
map(f, [$1..100]); # Robert Israel, Jan 03 2024
PROG
(Python)
import sympy
from sympy import isprime
def Lep(n):
..for k in range(2*10**3):
....num = k**n
....for i in range(2, k):
......num -= i**n
......if num < 0:
........return None
....if isprime(num):
......return k
n = 1
while n < 100:
..if Lep(n) == None:
....print(0)
..else:
....print(Lep(n))
..n += 1
(PARI) a(n)=k=1; while((s=k^n-sum(i=2, k-1, i^n))>0, if(isprime(s), return(k)); k++)
for(n=1, 100, print1(a(n), ", ")) \\ Derek Orr, Mar 12 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 31 2014
STATUS
approved