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!)
A240081 Least number k such that k^n-(k-1)^n-...-3^n-2^n-1 is prime. 2
0, 2, 2, 5, 2, 6, 2, 5, 0, 0, 0, 6, 2, 0, 0, 6, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) = 0 for n = {1, 9, 10, 11, 14, 15, 18...} because at certain k-values, k^n-(k-1)^n-...-3^n-2^n-1 becomes a strictly decreasing negative sequence. Thus, no number will be prime.
See A240082 for the n-values with nonzero entries.
LINKS
EXAMPLE
2^4-1 = 15 is not prime. 3^4-2^4-1 = 64 is not prime. 4^4-3^4-2^4-1 = 158 is not prime. 5^4-4^4-3^4-2^4-1 = 271 is prime. Thus, a(4) = 5.
MATHEMATICA
a[n_] := Block[{s=1, k=1}, While[s > 0 && ! PrimeQ[s], s -= 2*k^n; s += (++k)^n]; If[s > 0, k, 0]]; Array[a, 90] (* Giovanni Resta, Apr 01 2014 *)
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 < 100:
..if Leq(n) == None:
....print(0)
..else:
....print(Leq(n))
..n += 1
CROSSREFS
Cf. A240082.
Sequence in context: A319895 A323504 A011143 * A305791 A299764 A301830
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 August 19 06:29 EDT 2024. Contains 375284 sequences. (Running on oeis4.)