login
A181483
Number of powers of 2 which can be subtracted from 3^n to form primes
2
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,2
COMMENTS
Note that if a 2^m is too large or too small, 3^n-2^m is either negative or fractional (respectively) and cannot ever be prime, thus 0 <= a(n) <= floor(n*log_2(3))
Zeros in this sequence are in A181484, which correspond to -1s in A180303
EXAMPLE
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
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl R. White, Oct 23 2010
STATUS
approved