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 A329873 #14 Jan 26 2022 11:55:06 %S A329873 0,0,1,1,1,3,2,2,1,3,3,5,2,5,3,2,1,4,3,6,3,6,5,6,2,5,5,6,3,6,3,3,1,4, %T A329873 4,7,3,9,6,7,3,8,6,9,5,8,6,8,2,6,5,7,5,8,6,8,3,6,6,9,3,8,4,3,1,4,4,8, %U A329873 4,9,7,9,3,11,9,11,6,11,7,10,3,8,8,12,6 %N A329873 a(n) is the number of distinct prime numbers whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n. %C A329873 This sequence is unbounded. %H A329873 Rémy Sigrist, <a href="/A329873/b329873.txt">Table of n, a(n) for n = 0..16384</a> %F A329873 A078826(n) <= a(n) <= A007306(n+1). %F A329873 a(2*n) = a(n) + A036987(n) for any n > 0. %F A329873 a(2^n) = 1 for any n > 0. %e A329873 The first terms, alongside the binary representations of n and of the corresponding prime numbers, are: %e A329873 n a(n) bin(n) {bin(p)} %e A329873 -- ---- ------ -------------------- %e A329873 0 0 0 {} %e A329873 1 0 1 {} %e A329873 2 1 10 {10} %e A329873 3 1 11 {11} %e A329873 4 1 100 {10} %e A329873 5 3 101 {10, 11, 101} %e A329873 6 2 110 {10, 11} %e A329873 7 2 111 {11, 111} %e A329873 8 1 1000 {10} %e A329873 9 3 1001 {10, 11, 101} %e A329873 10 3 1010 {10, 11, 101} %e A329873 11 5 1011 {10, 11, 101, 111, 1011} %e A329873 12 2 1100 {10, 11} %p A329873 b:= proc(n) option remember; `if`(n=0, {0}, %p A329873 map(x-> [x, 2*x+r][], b(iquo(n, 2, 'r')))) %p A329873 end: %p A329873 a:= n-> nops(select(isprime, b(n))): %p A329873 seq(a(n), n=0..84); # _Alois P. Heinz_, Jan 26 2022 %o A329873 (PARI) a(n,base=2) = { my (b=digits(n,base), s=[0]); for (k=1, #b, s = setunion(s, apply(o -> base*o+b[k], s))); #select(isprime, s) } %Y A329873 Cf. A007306, A036987, A078826, A303077. %K A329873 nonn,look,base %O A329873 0,6 %A A329873 _Rémy Sigrist_, Nov 23 2019