OFFSET
1,2
COMMENTS
The sequence is a quasi-inverse of A161560: For n >= 2, a(A161560(n+1)+1) = n or n-1. - Jaroslav Krizek, Jun 13 2009, corrected Jul 13 2012
Conjecture: Essentially partial sums of A036577 (true for at least 10000 terms). - Sean A. Irvine, Jul 17 2022
From Bartlomiej Pawlik, Apr 19 2026: (Start)
Proof of the conjecture:
Let z(n) be the position of the n-th 0 in the binary Thue-Morse sequence A010060, with z(0) = 0. Since A001969 lists the indices of 0's in A010060, we have z(n) = A001969(n+1). Also, A036577 gives the number of 1's between successive 0's in A010060, so A036577(n+1) = z(n+1) - z(n) - 1.
Therefore, for n >= 1, Sum_{k=1..n-1} A036577(k) = Sum_{k=0..n-2} (z(k+1) - z(k) - 1) = z(n-1) - (n-1) = A001969(n) - n + 1 = a(n).
Hence a(n) is exactly the sequence of partial sums of A036577, with initial term a(1) = 0.
a(k) is the number of 1's before the (k+1)-th 0 in binary Thue-Morse sequence A010060. (End)
FORMULA
a(n) = A001969(n) - n + 1 for n >= 2. - Jaroslav Krizek, Jun 13 2009
EXAMPLE
a(5) = 5 because the fifth evil number = 9 and floor(9/2 + 1/2) = 5.
PROG
(PARI) a(n)=(2*n+hammingweight(n-1)%2-1)\2 \\ Charles R Greathouse IV, Mar 22 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Michael Joseph Halm, May 13 2004
EXTENSIONS
Corrected and edited by Jaroslav Krizek, Jun 13 2009
STATUS
approved
