login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254379 Characteristic function of the even odious numbers (A128309). 4
0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
a(n) is also the characteristic function of A129771 (the odd evil numbers), offset by 1.
Cf. A228495 the characteristic function of the odd odious numbers (A092246).
The characteristic function of the odious numbers (A000069) is given by the Thue-Morse sequence (A010060).
LINKS
FORMULA
a(n) = A059841(n)*A010060(n) = 1-A254651(n). - Antti Karttunen, Oct 01 2018
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
Sequence in context: A353463 A260445 A156731 * A288257 A285666 A120325
KEYWORD
nonn,easy,base
AUTHOR
Jeremy Gardiner, Jan 29 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:00 EDT 2024. Contains 371917 sequences. (Running on oeis4.)