OFFSET
0,3
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..300
Index entries for linear recurrences with constant coefficients, signature (1,1,-1,1,0,-1).
FORMULA
G.f.: 1/(1 - x - x^2 + x^3 - x^4 + x^6).
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) - a(n-6) with a(n) = 0 for n = -5, -4, -3, -2, -1 and a(0) = 1.
a(n) = b(n) + b(n-1) + b(n-3) - (1-(-1)^n)/2 with b(n) = A003269(n) and b(-3) = b(-2) = b(-1) = 0.
a(n) = Sum_{k=0..floor(n/2)} binomial(floor(n-3*k/2)+1, n-2*k+1). - Taras Goy, Dec 24 2019
MAPLE
MATHEMATICA
CoefficientList[Series[1/(1-x-x^2+x^3-x^4+x^6), {x, 0, 40}], x] (* Michael De Vlieger, Dec 24 2019 *)
LinearRecurrence[{1, 1, -1, 1, 0, -1}, {1, 1, 2, 2, 4, 5}, 50] (* Harvey P. Dale, Mar 27 2022 *)
PROG
(PARI) Vec(1/(1-x-x^2+x^3-x^4+x^6) +O(x^40)) /* show terms */ \\ Bruno Berselli, Jul 22 2011
(Maxima) makelist(coeff(taylor(1/(1-x-x^2+x^3-x^4+x^6), x, 0, n), x, n), n, 0, 40); /* Bruno Berselli, Jul 22 2011 */
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!(1/(1-x-x^2+x^3-x^4+x^6))); // Bruno Berselli, Jul 22 2011
(Sage)
def A193146_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( 1/(1-x-x^2+x^3-x^4+x^6) ).list()
A193146_list(40) # G. C. Greubel, Jan 01 2020
(GAP) a:=[1, 1, 2, 2, 4, 5];; for n in [7..40] do a[n]:=a[n-1]+a[n-2]-a[n-3]+a[n-4]-a[n-6]; od; a; # G. C. Greubel, Jan 01 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Johannes W. Meijer, Jul 20 2011
STATUS
approved