login
a(n) = 2^floor(log_2(n)) - 2^floor(log_2(n*2/3)).
0

%I #7 Jun 26 2021 21:27:35

%S 0,0,1,0,2,2,0,0,4,4,4,4,0,0,0,0,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,16,

%T 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,

%U 0,0,0,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32

%N a(n) = 2^floor(log_2(n)) - 2^floor(log_2(n*2/3)).

%F a(2n) = 2*a(n) + [n==1], a(2n+1) = 2*a(n).

%F G.f.: 1/(1-x) * Sum_{k>=0} 2^k*(t^2 - t^3) where t = x^(2^k).

%o (PARI) a(n)=if(n<1,0,if(n%2==0,2*a(n/2)+(n/2==1),2*a((n-1)/2)))

%o (PARI) a(n)=2^floor(log(n)/log(2))-2^floor(log(n*2/3)/log(2))

%Y Cf. A053644.

%K nonn,easy

%O 0,5

%A _Ralf Stephan_, Oct 30 2003