Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A254651
Characteristic function of A254614, numbers that are either odd or evil (or both).
3
1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0
OFFSET
0
COMMENTS
A254614 is the complement of A128309 (even odious numbers).
A254379 is the characteristic function of A128309.
FORMULA
a(n) = 1-A254379(n).
EXAMPLE
A254614 begins 0,1,3,5, hence this sequence begins 1,1,0,1,0,1.
MATHEMATICA
a[n_] := If[OddQ[n] || !OddQ[DigitCount[n, 2, 1]], 1, 0]; Array[a, 100, 0] (* Amiram Eldar, Aug 07 2023 *)
PROG
(PARI) A254651(n) = bitor((n%2), !(hammingweight(n)%2)); \\ Antti Karttunen, Oct 01 2018
(Python)
def A254651(n): return (n&1^1)&n.bit_count()^1 # Chai Wah Wu, Mar 09 2023
CROSSREFS
Cf. A128309, A254377, A254379, A254614, A254655 (run lengths).
Sequence in context: A065251 A039982 A267349 * A267579 A285414 A131372
KEYWORD
nonn,base
AUTHOR
Jeremy Gardiner, Feb 04 2015
EXTENSIONS
Name amended by Antti Karttunen, Oct 01 2018
STATUS
approved