OFFSET
0
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65537
FORMULA
EXAMPLE
A128309 begins 2, 4, 8, hence this sequence begins 0, 0, 1, 0, 1, 0, 0, 0, 1.
MATHEMATICA
a[n_] := If[EvenQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0]; Array[a, 100, 0] (* Amiram Eldar, Aug 06 2023 *)
PROG
(PARI) a(n)=n%2==0 && hammingweight(n)%2 \\ Charles R Greathouse IV, May 09 2016
(Python)
def A254379(n): return (n&1^1)&n.bit_count() # Chai Wah Wu, Mar 09 2023
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Jeremy Gardiner, Jan 29 2015
STATUS
approved