OFFSET
1,4
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
prime(17)=59 and only 59-2^3 = 53 is prime hence a(17)=1
MATHEMATICA
f[p_] := Block[{c = exp = 0, lmt = 1 + Floor@ Log2@ p}, While[exp < lmt, If[ PrimeQ[p - 2^exp], c++]; exp++]; c]; Array[ f@ Prime@# &, 105] (* Robert G. Wilson v, Jul 07 2014 *)
PROG
(PARI) a(n)=sum(i=0, floor(log(prime(n))/log(2)), if(isprime(prime(n)-2^i), 1, 0))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Dec 17 2002
STATUS
approved