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 A184907 #16 Dec 15 2024 12:11:43 %S A184907 0,1,4,0,4,7,0,4,5,0,1,6,0,9,3,0,6,5,0,8,5,0,3,2,0,6,3,0,3,9,0,5,5,0, %T A184907 3,6,0,5,2,0,8,6,0,8,6,0,2,12,0,8,1,0,2,7,0,2,1,0,4,5,0,7,5,0,8,6,0,7, %U A184907 6,0,3,9,0,4,11,0,4,5,0,5,2 %N A184907 Let S_n be the set of the integers having alternating bit sum equal to n. There are a(n) primes among the smallest 2n+1 numbers of S_n. %C A184907 The smallest 2n+1 numbers in the set S_n are given by (4^(n+1)-1)/3 - (-2)^k for k in 0..2*n. - _Andrew Howroyd_, Dec 15 2024 %H A184907 Andrew Howroyd, <a href="/A184907/b184907.txt">Table of n, a(n) for n = 0..500</a> %H A184907 Washington Bomfim, <a href="http://oeis.org/w/images/2/26/A184907.txt">A method to find the first 2n+1 integers having alternating bit sum equal to n</a>. %F A184907 a(n) = 0 for n == 0 (mod 3). - _Andrew Howroyd_, Dec 15 2024 %e A184907 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. %o A184907 (PARI)II()={i = (4^n - 1)/3 - 2^(2*n-2) + 2^(2*n); if(isprime(i),an++)}; %o A184907 III()={w = 2^(2*n-2); for(j=1, n-1, i += w; w /= 4; i -= w; if(isprime(i), an++;))}; %o A184907 IV()={i+=3; if(isprime(i), an++); w=2; for(j=1, n-1, i -= w; w *= 4; i+=w; if(isprime(i),an++))}; %o A184907 print1("0, 1, 4, ");for(n=3,80, an=0; II(); III(); IV(); print1(an,", ")) \\ _Washington Bomfim_, Jan 25 2011 %o A184907 (PARI) a(n)={my(m=(4^(n+1)-1)/3); sum(k=0, 2*n, isprime(bitxor(m,1<<k)))} \\ _Andrew Howroyd_, Dec 15 2024 %Y A184907 Cf. A065359, A065084, A002450, A184908. %K A184907 nonn %O A184907 0,3 %A A184907 _Washington Bomfim_, Jan 25 2011