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 A292599 #13 Sep 29 2017 10:31:51 %S A292599 0,1,1,2,3,2,3,4,4,6,7,4,5,6,6,8,9,8,9,12,12,14,15,8,8,10,10,12,13,12, %T A292599 13,16,16,18,18,16,17,18,18,24,25,24,25,28,28,30,31,16,16,16,16,20,21, %U A292599 20,20,24,24,26,27,24,25,26,26,32,32,32,33,36,36,36,37,32,33,34,34,36,36,36,37,48,48,50,51,48,48,50,50,56,57,56,56,60,60,62,62,32 %N A292599 a(1) = 0; for n > 1, a(n) = A010051(n) + 2*a(floor(n/2)). %C A292599 1-bits in base-2 expansion of a(n) indicate the positions of primes in the sequence [n, floor(n/2), floor(n/4), ..., 1]. %H A292599 Antti Karttunen, <a href="/A292599/b292599.txt">Table of n, a(n) for n = 1..16384</a> %H A292599 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A292599 a(1) = 0; for n > 1, a(n) = A010051(n) + 2*a(floor(n/2)). %F A292599 Other identities. For all n >= 1: %F A292599 A000120(a(n)) = A078349(n). %F A292599 A007814(1+a(n)) = A292936(n). %p A292599 A292599 := proc(n) %p A292599 option remember; %p A292599 if n = 1 then %p A292599 0 ; %p A292599 else %p A292599 A010051(n) + 2*procname(floor(n/2)) ; %p A292599 end if; %p A292599 end proc: %p A292599 seq(A292599(n),n=1..100) ; # _R. J. Mathar_, Sep 28 2017 %t A292599 a[1] = 0; a[n_] := a[n] = Boole[PrimeQ[n]] + 2*a[Floor[n/2]]; Array[a, 96] (* _Jean-François Alcover_, Sep 29 2017 *) %o A292599 (Scheme, with memoization-macro definec) %o A292599 (definec (A292599 n) (if (<= n 1) 0 (+ (A010051 n) (* 2 (A292599 (floor->exact (/ n 2))))))) %Y A292599 Cf. A010051, A078349, A292258, A292259, A292936. %Y A292599 Cf. also A292596 (variant for odd primes). %K A292599 nonn %O A292599 1,4 %A A292599 _Antti Karttunen_, Sep 27 2017