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!)
A245459 Number of primes of the form k^n - 2^k for positive integers k. 4
0, 0, 1, 4, 3, 2, 3, 5, 1, 4, 2, 4, 0, 6, 2, 2, 1, 2, 3, 5, 1, 9, 1, 4, 2, 3, 1, 2, 2, 2, 1, 4, 1, 5, 1, 2, 3, 3, 1, 2, 2, 1, 0, 3, 0, 1, 1, 2, 1, 4, 0, 1, 0, 3, 0, 3, 0, 2, 1, 4, 5, 3, 0, 3, 5, 9, 1, 5, 1, 6, 1, 0, 1, 4, 1, 1, 0, 4, 1, 4, 0, 3, 1, 0, 0, 7, 1, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
The values of k such that k^n - 2^k is prime for n = 1, 2, ..., 13 are
1) -
2) -
3) 3;
4) 3, 5, 7, 13;
5) 9, 19, 21;
6) 13, 17;
7) 3, 25, 31;
8) 3, 9, 13, 19, 29;
9) 13;
10) 9, 23, 31, 47;
11) 31, 45;
12) 7, 29, 41, 47;
13) -
LINKS
FORMULA
a(n) = |{k from positive integers: k^n - 2^k = prime}| for n >= 1. - Wolfdieter Lang, Aug 15 2014
EXAMPLE
a(4) = 4 because 3^4 - 2^3 = 73 (prime), 5^4 - 2^5 = 593 (prime), 7^4 - 2^7 = 2273 (prime), 13^4 - 2^13 = 20369 (prime).
MAPLE
A245459:= proc(n)
local T, k, x;
T:= 0;
for k from 3 by 2 do
x:= k^n - 2^k;
if x <= 0 then return T fi;
if isprime(x) then T:= T+1 fi;
od:
end proc:
seq(A245459(n), n=1..100); # Robert Israel, Jul 23 2014
MATHEMATICA
a[n_] := Module[{cnt = 0, k, x}, For[k = 3, True, k = k+2, x = k^n-2^k; If[x <= 0, Return[cnt]]; If[PrimeQ[x], cnt++]]; cnt];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 05 2023, after Robert Israel *)
PROG
(PARI)
a(n) = my(m=0, k=2); while(k^n>2^k, if(ispseudoprime(k^n-2^k), m++); k++); m
vector(80, n, a(n)) \\ Colin Barker, Jul 27 2014
(Python)
import sympy
def a(n):
..k = 2
..count = 0
..while k**n > 2**k:
....if sympy.isprime(k**n-2**k):
......count += 1
....k += 1
..return count
n = 1
while n < 100:
..print(a(n), end=', ')
..n += 1 # Derek Orr, Aug 02 2014
CROSSREFS
Sequence in context: A076576 A332558 A183197 * A001368 A197224 A340739
KEYWORD
nonn
AUTHOR
EXTENSIONS
Terms corrected by Robert Israel, Jul 23 2014
More terms from Colin Barker, Jul 27 2014
Name edited with k range given by Wolfdieter Lang, Aug 15 2014
More terms from Jinyuan Wang, Feb 24 2020
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 April 23 09:48 EDT 2024. Contains 371905 sequences. (Running on oeis4.)