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!)
A246016 a(n) = (-1)^A055941(n). 2
1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
This sequence and A246017 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_] := (-1)^a55941[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) = (-1)^a055941(n);
(Python)
def A246016(n):
a, b = 0, 0
for i, j in enumerate(bin(n)[:1:-1]):
if int(j):
a ^= (i&1)^b
b ^= 1
return -1 if a else 1 # Chai Wah Wu, Jul 26 2023
CROSSREFS
Cf. A055941, A161511, A246017 (partial sums).
Sequence in context: A292117 A098417 A143622 * A306638 A076479 A155040
KEYWORD
sign
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 24 18:03 EDT 2024. Contains 371962 sequences. (Running on oeis4.)