Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #28 Jan 28 2023 12:20:25
%S 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,
%T 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,1,0,0,0,1,
%U 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,0,0,0,0,0
%N Indicator function of numbers whose binary representation ends in an even positive number of 0's.
%C The asymptotic mean of this sequence is 1/6. - _Amiram Eldar_, Jan 12 2021
%H Amiram Eldar, <a href="/A328981/b328981.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F a(n) = 1 - A096268(n - 1) - (n mod 2). - _Velin Yanev_, Nov 30 2019, _Antti Karttunen_, Jan 28 2023
%F a(A108269(n)) = 1. - _Amiram Eldar_, Jan 12 2021
%F a(n) = 1 - A359832(n). - _Antti Karttunen_, Jan 28 2023
%p a:= n-> `if`((t-> t>0 and t::even)(padic[ordp](n, 2)), 1, 0):
%p seq(a(n), n=1..120); # _Alois P. Heinz_, Dec 03 2019
%t a[n_] := Boole[And @@ EvenQ[{n, IntegerExponent[n, 2]}]]; Array[a, 100] (* _Amiram Eldar_, Jan 12 2021 *)
%o (Python)
%o def A328981(n): return ((n&1)|((~n & n-1).bit_length()&1))^1 # _Chai Wah Wu_, Jan 24 2023
%o (PARI) A328981(n) = (!(n%2)&&!(valuation(n,2)%2)); \\ _Antti Karttunen_, Jan 28 2023
%Y Characteristic function of A108269.
%Y Cf. A096268, A359832 (one's complement).
%K nonn
%O 1
%A _N. J. A. Sloane_, Nov 05 2019