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!)
A246017 Partial sums of A246016. 2
1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7, 8, 7, 8, 7, 6, 7, 6, 5, 6, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 10, 11, 10, 9, 10, 9, 8, 9, 8, 9, 10, 9, 8, 9, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
This sequence and A246016 are the subject of the Lafrance et al. (2014) paper.
LINKS
Philip Lafrance, Narad Rampersad, Randy Yee, Some properties of a Rudin-Shapiro-like sequence, arXiv:1408.2277 [math.CO], 2014.
MATHEMATICA
b[n_] := b[n] = If[n == 0, 0, If[EvenQ[n], b[n/2] + DigitCount[n/2, 2, 1], b[(n - 1)/2] + 1]];
a55941[n_] := b[n] - DigitCount[n, 2, 1];
a[n_] := Sum[(-1)^a55941[k], {k, 0, n}];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 23 2018 *)
PROG
(PARI) a055941(n) = {my(b=binary(n)); nb = 0; for (i=1, #b-1, if (b[i], nb += sum(j=i+1, #b, !b[j])); ); nb; }
a(n) = sum(k=0, n, (-1)^a055941(k));
(Python)
def A246017(n):
c = 0
for k in range(n+1):
a, b = 0, 1
for i, j in enumerate(bin(k)[:1:-1]):
if int(j):
a ^= (i&1)^(b:=b^1)
c += -1 if a else 1
return c # Chai Wah Wu, Jul 26 2023
CROSSREFS
Sequence in context: A033923 A233420 A220098 * A116939 A253174 A008611
KEYWORD
nonn,look
AUTHOR
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 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)