OFFSET
1
COMMENTS
The asymptotic mean of this sequence is 1/6. - Amiram Eldar, Jan 12 2021
LINKS
FORMULA
a(A108269(n)) = 1. - Amiram Eldar, Jan 12 2021
a(n) = 1 - A359832(n). - Antti Karttunen, Jan 28 2023
MAPLE
a:= n-> `if`((t-> t>0 and t::even)(padic[ordp](n, 2)), 1, 0):
seq(a(n), n=1..120); # Alois P. Heinz, Dec 03 2019
MATHEMATICA
a[n_] := Boole[And @@ EvenQ[{n, IntegerExponent[n, 2]}]]; Array[a, 100] (* Amiram Eldar, Jan 12 2021 *)
PROG
(Python)
def A328981(n): return ((n&1)|((~n & n-1).bit_length()&1))^1 # Chai Wah Wu, Jan 24 2023
(PARI) A328981(n) = (!(n%2)&&!(valuation(n, 2)%2)); \\ Antti Karttunen, Jan 28 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 05 2019
STATUS
approved