OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..65534
Ilya Gutkovskiy, Scatter plot of a(n) up to n=1000
FORMULA
a(0) = 0; a(2*n+2) = -2*a(n) + 1, a(2*n+1) = 2*a(n) + 1.
MAPLE
a:= proc(n) option remember; `if`(n=0, 0, 2*
`if`(irem(n, 2, 'r')=0, -a(r-1), a(r))+1)
end:
seq(a(n), n=0..2^7-2); # Alois P. Heinz, Aug 29 2019
MATHEMATICA
nmax = 66; A[_] = 0; Do[A[x_] = 2 x (1 - x) A[x^2] + x/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
a[0] = 0; a[n_] := If[EvenQ[n], -2 a[(n - 2)/2] + 1, 2 a[(n - 1)/2] + 1]; Table[a[n], {n, 0, 66}]
CROSSREFS
AUTHOR
Ilya Gutkovskiy, Aug 28 2019
STATUS
approved