login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A153639
Evilness of triangular numbers.
0
1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1
OFFSET
0,1
COMMENTS
The evilness of a number is 1 if the number is evil and 0 otherwise. The number is evil if it has an even number of ones in its binary expansion.
MATHEMATICA
od[n_] := Mod[Count[IntegerDigits[n, 2], 1], 2] Table[1 - od[n (n + 1)/2], {n, 0, 128}]
If[EvenQ[DigitCount[#, 2, 1]], 1, 0]&/@Accumulate[Range[0, 110]] (* Harvey P. Dale, Nov 17 2018 *)
CROSSREFS
A000217 Triangular numbers. A001969 Evil numbers.
Sequence in context: A105594 A091949 A039984 * A319102 A103582 A129565
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Dec 29 2008
STATUS
approved