OFFSET
0,3
COMMENTS
Partial sums are A115637.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..1024
R. Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
FORMULA
G.f.: Sum_{k>=0} 4^k*x^(2^(k+1)-2)/(1+x^(2^k)); the g.f. G(x) satisfies G(x) - 4*x^2*G(x^2) = 1/(1+x).
MATHEMATICA
A115637[n_] := FromDigits[1 - IntegerDigits[n + 2, 2], 4];
Differences[Array[A115637, 100, -1]] (* Paolo Xausa, Jul 17 2024 *)
PROG
(PARI) A115638(n) = if(!n, 1, A115637(n)-A115637(n-1)); \\ (Needs also code from A115637) - Antti Karttunen, Nov 02 2018
(Python)
def A115638(n): return int(bin((~(n+2))^(-1<<(n+2).bit_length()))[2:], 4)-int(bin((~(n+1))^(-1<<(n+1).bit_length()))[2:], 4) # Chai Wah Wu, Jul 17 2024
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Jan 27 2006
STATUS
approved