[go: up one dir, main page]

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”).

A145865
a(0) = 0, a(1) = 1, a(2n) = a(n), a(2n+1) = a(n) - a(n+1).
1
0, 1, 1, 0, 1, 1, 0, -1, 1, 0, 1, 1, 0, 1, -1, -2, 1, 1, 0, -1, 1, 0, 1, 1, 0, -1, 1, 2, -1, 1, -2, -3, 1, 0, 1, 1, 0, 1, -1, -2, 1, 1, 0, -1, 1, 0, 1, 1, 0, 1, -1, -2, 1, -1, 2, 3, -1, -2, 1, 3, -2, 1, -3, -4, 1, 1, 0, -1, 1, 0, 1, 1, 0, -1, 1, 2, -1, 1, -2, -3, 1, 0, 1, 1, 0, 1, -1, -2, 1, 1, 0
OFFSET
0,16
COMMENTS
Variation on Stern's Diatomic Series
LINKS
FORMULA
From Chai Wah Wu, Dec 20 2016: (Start)
a(2^k*n+1) = a(n+1) if k is even
a(2^k*n+1) = a(n)-a(n+1) = a(2n+1) if k is odd
a(2^k*n+2^k-1) = a(n) - k*a(n+1)
a(2^k*n+2^k-3) = a(n+1) for k >= 2
a(2^k*n+2^k-5) = (k-1)*a(n+1)-a(n) for k >= 3
a(2^k*n+2^k-7) = a(n) - (k-2)*a(n+1) for k >= 3
This implies that
a(2^k+1) = 1 if k is even
a(2^k+1) = 0 if k is odd
a(2^k-1) = 2 - k for k >= 1
a(2^k-3) = 1 for k >= 2
a(2^k-5) = k - 3 for k >= 3
a(2^k-7) = 4 - k for k >= 3
(End)
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = If[EvenQ@ n, a[n/2], a[#] - a[# + 1] &[(n - 1)/2]]; Table[a@ n, {n, 0, 85}] (* Michael De Vlieger, Dec 21 2016 *)
CROSSREFS
Sequence in context: A369454 A224444 A101808 * A341281 A076452 A076453
KEYWORD
easy,sign
AUTHOR
STATUS
approved