This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A245459 #37 May 22 2025 10:21:40 %S A245459 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, %T A245459 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, %U A245459 1,6,1,0,1,4,1,1,0,4,1,4,0,3,1,0,0,7,1,4 %N A245459 Number of primes of the form k^n - 2^k for positive integers k. %C A245459 The values of k such that k^n - 2^k is prime for n = 1, 2, ..., 13 are %C A245459 1) - %C A245459 2) - %C A245459 3) 3; %C A245459 4) 3, 5, 7, 13; %C A245459 5) 9, 19, 21; %C A245459 6) 13, 17; %C A245459 7) 3, 25, 31; %C A245459 8) 3, 9, 13, 19, 29; %C A245459 9) 13; %C A245459 10) 9, 23, 31, 47; %C A245459 11) 31, 45; %C A245459 12) 7, 29, 41, 47; %C A245459 13) - %H A245459 Jinyuan Wang, <a href="/A245459/b245459.txt">Table of n, a(n) for n = 1..450</a> %F A245459 a(n) = |{k from positive integers: k^n - 2^k = prime}| for n >= 1. - _Wolfdieter Lang_, Aug 15 2014 %e A245459 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). %p A245459 A245459:= proc(n) %p A245459 local T,k,x; %p A245459 T:= 0; %p A245459 for k from 3 by 2 do %p A245459 x:= k^n - 2^k; %p A245459 if x <= 0 then return T fi; %p A245459 if isprime(x) then T:= T+1 fi; %p A245459 od: %p A245459 end proc: %p A245459 seq(A245459(n),n=1..100); # _Robert Israel_, Jul 23 2014 %t A245459 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]; %t A245459 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Feb 05 2023, after _Robert Israel_ *) %o A245459 (PARI) %o A245459 a(n) = my(m=0, k=2); while(k^n>2^k, if(ispseudoprime(k^n-2^k), m++); k++); m %o A245459 vector(80, n, a(n)) \\ _Colin Barker_, Jul 27 2014 %o A245459 (Python) %o A245459 import sympy %o A245459 def a(n): %o A245459 k = 2 %o A245459 count = 0 %o A245459 while k**n > 2**k: %o A245459 if sympy.isprime(k**n-2**k): %o A245459 count += 1 %o A245459 k += 1 %o A245459 return count %o A245459 n = 1 %o A245459 while n < 100: %o A245459 print(a(n),end=', ') %o A245459 n += 1 # _Derek Orr_, Aug 02 2014 %K A245459 nonn %O A245459 1,4 %A A245459 _Juri-Stepan Gerasimov_, Jul 22 2014 %E A245459 Terms corrected by _Robert Israel_, Jul 23 2014 %E A245459 More terms from _Colin Barker_, Jul 27 2014 %E A245459 Name edited with k range given by _Wolfdieter Lang_, Aug 15 2014 %E A245459 More terms from _Jinyuan Wang_, Feb 24 2020