login
a(n) = 2^j if n is of the form 2^i - 2^j with i > j, and 0 otherwise.
3

%I #9 Feb 14 2021 18:40:19

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

%T 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,0,0,0,4,0,2,1,64,0,

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

%N a(n) = 2^j if n is of the form 2^i - 2^j with i > j, and 0 otherwise.

%H Antti Karttunen, <a href="/A341509/b341509.txt">Table of n, a(n) for n = 0..65537</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(0) = 0, and for n >= 1, a(n) = A340375(n) * A006519(n).

%F a(n) = A156552(A014963(A005940(1+n))).

%o (PARI)

%o A006519(n) = (1<<valuation(n, 2));

%o A340375(n) = if(n<5, 1, n>>=valuation(n, 2); n++; n>>valuation(n, 2)==1); \\ After function "is" given in A023758

%o A341509(n) = if(!n,n,A340375(n)*A006519(n));

%Y Cf. A005940, A006519, A014963, A156552, A340375.

%Y Cf. A023758 (after its initial zero, gives the positions nonzero terms).

%K nonn

%O 0,3

%A _Antti Karttunen_, Feb 13 2021