OFFSET
0,3
LINKS
EXAMPLE
The smallest 2n+1 = 5 numbers of the set S_2 of the integers having alternating bit sum 2, are 5, 17, 20, 23, and 29, so a(2)=4.
PROG
(PARI)II()={i = (4^n - 1)/3 - 2^(2*n-2) + 2^(2*n); if(isprime(i), an++)};
III()={w = 2^(2*n-2); for(j=1, n-1, i += w; w /= 4; i -= w; if(isprime(i), an++; ))};
IV()={i+=3; if(isprime(i), an++); w=2; for(j=1, n-1, i -= w; w *= 4; i+=w; if(isprime(i), an++))};
print1("0, 1, 4, "); for(n=3, 80, an=0; II(); III(); IV(); print1(an, ", ")) \\ Washington Bomfim, Jan 25 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Washington Bomfim, Jan 25 2011
STATUS
approved