A181483 Number of powers of 2 which can be subtracted from 3^n to form primes.
1, 2, 3, 3, 5, 2, 4, 3, 4, 3, 5, 1, 3, 2, 3, 4, 4, 1, 5, 2, 6, 4, 2, 1, 4, 1, 5, 2, 8, 1, 6, 1, 5, 3, 7, 0, 6, 3, 1, 0, 9, 1, 8, 8, 5, 1, 4, 4, 6, 1, 6, 1, 4, 3, 5, 3, 2, 2, 4, 2, 2, 3, 3, 5, 2, 0, 7, 1, 5, 2, 3, 4, 5, 2, 1, 4, 5, 1, 4, 1, 4, 5, 4, 3, 4, 2, 6, 1, 9, 3, 3, 2, 2, 2, 5, 2, 3, 1, 5, 1, 6, 3, 1, 5, 4
Offset: 1
Keywords
Examples
3^1-2^0 = 2 which is prime, so a(1)=1 3^3-{2^4,2^3,2^2,2^1,2^0} = {11,19,23,25,26}, three of which are prime, so a(3) = 3
Programs
-
Mathematica
np[n_]:=Module[{p2=2^Range[0,Floor[Log[2,3^n]]]},Count[3^n-p2,?PrimeQ]]; Array[np,110] (* _Harvey P. Dale, Nov 06 2012 *)
Comments