OFFSET
0,2
LINKS
Matthew House, Table of n, a(n) for n = 0..10000
Michael Somos, Rational Function Multiplicative Coefficients, 2014.
Index entries for linear recurrences with constant coefficients, signature (2,-3,4,-3,2,-1).
FORMULA
Euler transform of length 5 sequence [5, -4, 0, 2, -1].
a(n) = 5 * b(n) unless n=0 where b() is multiplicative with b(2) = 11/5, b(2^e) = 2^e * 9/10 if e>1, b(p^e) = p^e if p>2.
a(-n) = -a(n) for all n in Z unless n=0. a(4*n) = 18*n unless n=0. a(4*n + 2) = 11 * (2*n + 1). a(2*n + 1) = 5 * (2*n + 1).
G.f.: 1 + 5*x / (1 - x)^2 + x^2 / (1 + x^2)^2.
a(n) = 2*a(n-1) - 3*a(n-2) + 4*a(n-3) - 3*a(n-4) + 2*a(n-5) - a(n-6). - Matthew House, Feb 12 2017
a(n) = (20 - (-i)^n - i^n)*n/4 for n>0, where i=sqrt(-1). - Colin Barker, Feb 12 2017
Sum_{k=1..n} a(k) ~ 5 * n^2 / 2. - Amiram Eldar, Dec 30 2023
EXAMPLE
G.f. = 1 + 5*x + 11*x^2 + 15*x^3 + 18*x^4 + 25*x^5 + 33*x^6 + 35*x^7 + 36*x^8 + ...
MATHEMATICA
a[ n_] := Boole[n == 0] + 5 n - If[ EvenQ[n], (-1)^(n/2) n/2, 0]; (* Michael Somos, Apr 17 2015 *)
a[ n_] := (-1)^Boole[n < 0] SeriesCoefficient[ (1 - x^2)^4 (1 - x^5) / ((1 - x)^5 (1 - x^4)^2), {x, 0, Abs@n}]; (* Michael Somos, Jan 07 2019 *)
PROG
(PARI) {a(n) = (n == 0) + 5*n - if( n%2==0, (-1)^(n/2) * n/2, 0)};
(PARI) Vec((1 + x)^2 * (1 + x + x^2 + x^3 + x^4) / ((1 - x)^2*(1 + x^2)^2) + O(x^60)) \\ Colin Barker, Feb 12 2017
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1 + 5*x/(1-x)^2 + x^2/(1+x^2)^2)); // G. C. Greubel, Sep 25 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Aug 13 2009
STATUS
approved
