OFFSET
1,4
COMMENTS
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].
LINKS
FORMULA
MAPLE
A292599 := proc(n)
option remember;
if n = 1 then
0 ;
else
A010051(n) + 2*procname(floor(n/2)) ;
end if;
end proc:
seq(A292599(n), n=1..100) ; # R. J. Mathar, Sep 28 2017
MATHEMATICA
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 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 27 2017
STATUS
approved