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!)
A240082 Numbers n such that k^n-(k-1)^n-...-3^n-2^n-1 is prime for some k. 1

%I #11 Apr 02 2014 11:56:13

%S 2,3,4,5,6,7,8,12,13,16,17,19,31,34,48,61,68,72,89,107,112,124,127,

%T 236,260,288,384,396,432,520,521,576,607,1080,1244,1279,1424,1500,

%U 1660,2203,2281,2640,2730,2808,3190,3217,4150,4253,4423,4428,5016,5892

%N Numbers n such that k^n-(k-1)^n-...-3^n-2^n-1 is prime for some k.

%C These are the values of n such that A240081(n) is nonzero.

%o (Python)

%o import sympy

%o from sympy import isprime

%o def Leq(n):

%o ..for k in range(1000):

%o ....num = k**n

%o ....for i in range(2, k):

%o ......num -= i**n

%o ......if num < 1:

%o ........return None

%o ....if isprime(num-1):

%o ......return k

%o n = 1

%o while n < 10**3:

%o ..if Leq(n) != None:

%o ....print(n)

%o ..n += 1

%o (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)

%Y Cf. A240081.

%K nonn

%O 1,1

%A _Derek Orr_, Mar 31 2014

%E a(34)-a(52) from _Giovanni Resta_, Apr 02 2014

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 April 19 17:51 EDT 2024. Contains 371797 sequences. (Running on oeis4.)