login
A240082
Numbers n such that k^n-(k-1)^n-...-3^n-2^n-1 is prime for some k.
1
2, 3, 4, 5, 6, 7, 8, 12, 13, 16, 17, 19, 31, 34, 48, 61, 68, 72, 89, 107, 112, 124, 127, 236, 260, 288, 384, 396, 432, 520, 521, 576, 607, 1080, 1244, 1279, 1424, 1500, 1660, 2203, 2281, 2640, 2730, 2808, 3190, 3217, 4150, 4253, 4423, 4428, 5016, 5892
OFFSET
1,1
COMMENTS
These are the values of n such that A240081(n) is nonzero.
PROG
(Python)
import sympy
from sympy import isprime
def Leq(n):
..for k in range(1000):
....num = k**n
....for i in range(2, k):
......num -= i**n
......if num < 1:
........return None
....if isprime(num-1):
......return k
n = 1
while n < 10**3:
..if Leq(n) != None:
....print(n)
..n += 1
(PARI) f(n)=for(k=1, 10^3, num=k^n; for(i=2, k-1, num-=i^n; if(num<1, return(0))); if(ispseudoprime(num-1), return(k))); n=1; while(n<10^3, if(f(n), print(n)); n+=1)
CROSSREFS
Cf. A240081.
Sequence in context: A119797 A032972 A210585 * A321334 A342044 A238084
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 31 2014
EXTENSIONS
a(34)-a(52) from Giovanni Resta, Apr 02 2014
STATUS
approved