login
a(n) = 1 if the binary weight of n is not greater than the 2-adic valuation of 2*n, otherwise 0.
1

%I #10 Jul 01 2024 04:20:07

%S 1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,

%T 0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,

%U 0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1

%N a(n) = 1 if the binary weight of n is not greater than the 2-adic valuation of 2*n, otherwise 0.

%H Antti Karttunen, <a href="/A373990/b373990.txt">Table of n, a(n) for n = 1..100000</a>

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

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(n) = [A000120(n) <= A001511(n)], where [ ] is the Iverson bracket.

%t A373990[n_] := Boole[DigitCount[n, 2, 1] <= IntegerExponent[n, 2] + 1];

%t Array[A373990, 100] (* _Paolo Xausa_, Jul 01 2024 *)

%o (PARI) A373990(n) = (hammingweight(n) <= (1+valuation(n, 2)));

%Y Characteristic function of A371176.

%Y Cf. A000120, A001511.

%K nonn

%O 1

%A _Antti Karttunen_, Jun 30 2024