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!)
A255817 Parity of A000788, which is the total number of ones in 0..n in binary. 1
0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
a(n) is also the parity of A115384.
a(n) is also the base 2 version of the process described in A256379.
LINKS
Jeffrey Shallit and Anatoly Zavyalov, Transduction of Automatic Sequences and Applications, arXiv:2303.15203 [cs.FL], 2023, see p. 5.
FORMULA
a(n) = A000788(n) mod 2 = (Sum_{k=0..n} A000120(k)) mod 2.
a(n) = A115384(n) mod 2 = (Sum_{k=0..n} A010060(k)) mod 2.
EXAMPLE
a(3) = 0, because there are an even number of ones in [0,1,10,11].
a(5) = 1, because there are an odd number of ones in [0,1,10,11,100,101].
MATHEMATICA
Boole @* OddQ /@ Accumulate@ Array[DigitCount[#, 2, 1] &, 120, 0] (* Michael De Vlieger, Mar 29 2023 *)
PROG
(Sage)
def A255817(N):
A = [0]
for n in range(1, N+1):
n2 = bin(n)[2:]
A.append(mod(A[-1]+sum([int(n2[j]) for j in range(len(n2))]), 2))
return A
A255817(120)
(Python)
def A255817(n): return ((n>>1)&1)^(n&1|((n+1).bit_count()&1^1)) # Chai Wah Wu, Mar 01 2023
CROSSREFS
Sequence in context: A138710 A356556 A330037 * A071674 A179829 A172486
KEYWORD
nonn,easy
AUTHOR
Danny Rorabaugh, Apr 01 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 July 11 00:26 EDT 2024. Contains 374215 sequences. (Running on oeis4.)