Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239472 Least number k such that k^n-(k-1)^n-...-3^n-2^n is prime. a(n) = 0 if no such number exists. 7
2, 3, 3, 7, 3, 0, 0, 0, 0, 7, 7, 0, 4, 0, 8, 11, 3, 16, 15, 0, 4, 7, 0, 23, 0, 19, 12, 11, 3, 0, 3, 7, 12, 0, 12, 0, 0, 0, 0, 0, 16, 0, 0, 0, 59, 11, 44, 32, 16, 0, 0, 0, 3, 0, 23, 0, 20, 75, 3, 0, 28, 0, 0, 0, 36, 0, 60, 0, 0, 0, 36, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 91, 75, 0, 0, 0, 32, 108, 7, 0, 60, 0, 40, 39, 0, 0, 0, 0, 80 (list; graph; refs; listen; history; text; internal format)
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
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
Cf. A240083.
Sequence in context: A289277 A140182 A340753 * A234943 A209494 A082910
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 31 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 19 05:20 EDT 2024. Contains 374388 sequences. (Running on oeis4.)