A262672 Expansion of (3-x-x^3) / ((x-1)^2*(1+x+x^2+x^3)).
3, 2, 2, 1, 4, 3, 3, 2, 5, 4, 4, 3, 6, 5, 5, 4, 7, 6, 6, 5, 8, 7, 7, 6, 9, 8, 8, 7, 10, 9, 9, 8, 11, 10, 10, 9, 12, 11, 11, 10, 13, 12, 12, 11, 14, 13, 13, 12, 15, 14, 14, 13, 16, 15, 15, 14, 17, 16, 16, 15, 18, 17, 17, 16, 19, 18, 18, 17, 20, 19, 19, 18, 21
Offset: 0
Examples
G.f. = 3 + 2*x + 2*x^2 + x^3 + 4*x^4 + 3*x^5 + 3*x^6 + 2*x^7 + 5*x^8 + 4*x^9 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..400
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
Programs
-
Magma
[(2*n+13+5*(-1)^n-6*(-1)^((2*n+3+(-1)^n) div 4))/8 : n in [0..100]];
-
Magma
&cat[[3+n,2+n,2+n,1+n]: n in [0..20]]; // Bruno Berselli, Sep 29 2015
-
Magma
I:=[3,2,2,1,4]; [n le 5 select I[n] else Self(n-1) + Self(n-4) - Self(n-5): n in [1..100]]; // Vincenzo Librandi, Sep 29 2015
-
Maple
A262672:=n->(2*n+13+5*(-1)^n-6*(-1)^((2*n+3+(-1)^n)/4))/8: seq(A262672(n), n=0..100);
-
Mathematica
Table[(2n + 13 + 5 (-1)^n - 6 (-1)^((2n + 3 + (-1)^n)/4))/8, {n, 0, 100}] LinearRecurrence[{1, 0, 0, 1, -1}, {3, 2, 2, 1, 4}, 100] (* Vincenzo Librandi, Sep 29 2015 *) CoefficientList[Series[(3-x-x^3)/((x-1)^2(1+x+x^2+x^3)),{x,0,100}],x] (* Harvey P. Dale, May 26 2023 *)
-
PARI
a(n) = (2*n+13+5*(-1)^n-6*(-1)^((2*n+3+(-1)^n)/4))/8; vector(80, n, a(n-1)) \\ Altug Alkan, Sep 29 2015
-
PARI
{a(n) = my(k = n\4); [ 3, 2, 2, 1][n%4 + 1] + k}; /* Michael Somos, Oct 02 2015 */
Formula
G.f.: (3-x-x^3) / ((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1) + a(n-4) - a(n-5), for n>4
a(n) = ( 2*n + 13+5*(-1)^n - 6*(-1)^((2*n + 3 + (-1)^n)/4) )/8.
4*a(n) = |A118402(n+8)| + 3*i^(n*(n-1)), where i=sqrt(-1). [Bruno Berselli, Sep 29 2015]
E.g.f.: (1/8)*(2*x*exp(x) + 5*exp(-x) + 13*exp(x) + 6*sin(x) + 6*cos(x)). - G. C. Greubel, Sep 29 2015
a(n) = -a(-13 - n) for all n in Z. - Michael Somos, Oct 02 2015
Extensions
Edited by Bruno Berselli, Sep 30 2015
Comments