OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16384 (first 1025 terms from Antti Karttunen)
Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003, see equation 2.4 with a(n) = a_{n+2} for case alpha=4, c=1, d=0.
FORMULA
G.f.: (1/(1-x))*Sum_{k>=0} 4^k*x^(2^(k+1)-2)/(1+x^(2^k)); the g.f. G(x) satisfies G(x) - 4(1+x)*x^2*G(x^2) = 1/(1-x^2).
MAPLE
b:= n-> 1-(n mod 2)+`if`(n<2, 0, b(iquo(n, 2))*4):
a:= n-> b(n+2):
seq(a(n), n=0..66); # Alois P. Heinz, Jul 16 2024
MATHEMATICA
A115637[n_] := FromDigits[1 - IntegerDigits[n + 2, 2], 4];
Array[A115637, 100, 0] (* Paolo Xausa, Jul 16 2024 *)
PROG
(PARI)
up_to = 1024;
A115633array(n, k) = (((-1)^n)*if(n==k, 1, if((k+k+2)==n, -4, if((k+1)==n, -(1+(-1)^k)/2, 0))));
A115637list(up_to) = { my(mA115633=matrix(up_to, up_to, n, k, A115633array(n-1, k-1)), mA115636 = matsolve(mA115633, matid(up_to)), v = vector(up_to)); for(n=1, up_to, v[n] = vecsum(mA115636[n, ])); (v); };
v115637 = A115637list(up_to+1);
A115637(n) = v115637[1+n]; \\ Antti Karttunen, Nov 02 2018
(PARI) a(n) = fromdigits([!b |b<-binary(n+2)], 4); \\ Kevin Ryde, Jul 15 2024
(Python)
def A115637(n): return int(bin((~(n+2))^(-1<<(n+2).bit_length()))[2:], 4) # Chai Wah Wu, Jul 17 2024
CROSSREFS
KEYWORD
AUTHOR
Paul Barry, Jan 27 2006
EXTENSIONS
New name from Kevin Ryde, Jul 15 2024
STATUS
approved