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

A131666
First differences of (A113405 prefixed with a 0).
6
0, 0, 1, 1, 2, 3, 7, 14, 29, 57, 114, 227, 455, 910, 1821, 3641, 7282, 14563, 29127, 58254, 116509, 233017, 466034, 932067, 1864135, 3728270, 7456541, 14913081, 29826162, 59652323, 119304647, 238609294, 477218589, 954437177, 1908874354
OFFSET
0,5
FORMULA
a(n+1) - 2*a(n) = 0, 1, -1, 0, -1, 1, ... is the hexaperiodic A092220 (corrected Sep 24 2007).
O.g.f.: x^2*(1-x)/((1+x)*(1-2*x)*(1-x+x^2)). - R. J. Mathar, Nov 23 2007
a(n) = Sum_{k=0..n-2} A001045(n-k+1)*binomial(k,n-k-2). - Paul Barry, Apr 22 2009
a(n) = (1/18)*( 2^(n+1) + 4*(-1)^n - 3*((-1)^floor((n+1)/3) + (-1)^floor((n+2)/3)) ). - G. C. Greubel, Nov 21 2019
MAPLE
seq(coeff(series(x^2*(1-x)/((1+x)*(1-2*x)*(1-x+x^2)), x, n+1), x, n), n = 0..35); # G. C. Greubel, Nov 21 2019
MATHEMATICA
Table[(2*(-1)^n +2^n -3*((-1)^Floor[(n+1)/3] +(-1)^Floor[(n+2)/3])/2)/9, {n, 0, 35}] (* G. C. Greubel, Nov 21 2019 *)
PROG
(PARI) my(x='x+O('x^35)); concat([0, 0], Vec(x^2*(1-x)/((1+x)*(1-2*x)*(1-x+x^2)))) \\ G. C. Greubel, Nov 21 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 35); [0, 0] cat Coefficients(R!( x^2*(1-x)/((1+x)*(1-2*x)*(1-x+x^2)) )); // G. C. Greubel, Nov 21 2019
(Sage)
def A131666_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(x^2*(1-x)/((1+x)*(1-2*x)*(1-x+x^2))).list()
A131666_list(35) # G. C. Greubel, Nov 21 2019
(GAP) a:=[0, 0, 1, 1];; for n in [5..35] do a[n]:=2*a[n-1]-a[n-3]+2*a[n-4]; od; a; # G. C. Greubel, Nov 21 2019
CROSSREFS
Sequence in context: A308092 A262765 A340163 * A135258 A034065 A034075
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 14 2007
STATUS
approved