OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Michael Somos, Rational Function Multiplicative Coefficients.
Index entries for linear recurrences with constant coefficients, signature (-2,-3,-4,-3,-2,-1).
FORMULA
a(n) is multiplicative with a(2) = -3, a(2^e) = -(2^(e-1)) if e>1, a(p^e) = p^e if p>2.
Euler transform of length 4 sequence [-3, 0, -1, 2].
G.f.: x * (1 - x)^3 * (1 - x^3) / (1 - x^4)^2.
G.f.: x * (1 + x + x^2) * (1 - x)^2 / ((1 + x)^2 * (1 + x^2)^2).
Dirichlet g.f. zeta(s-1)*( 1-5*2^(-s)+4^(1-s)). - R. J. Mathar, Mar 31 2011
a(n) = (-1)^(n+1)*n + (-1)^floor(n/2)*A027656(n-2). - R. J. Mathar, Mar 31 2011
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) with a(1)=1, a(2)=-3, a(3)=3, a(4)=-2, a(5)=5, a(6)=-9. - Harvey P. Dale, Aug 08 2012
G.f.: 1/(1+x) - 1/(1+x)^2 - 1/(1+x^2) + 1/(1+x^2)^2. - Michael Somos, Apr 24 2015
a(n) = -a(-n) for all n in Z. - Michael Somos, Apr 24 2015
G.f.: f(x) - f(x^2) where f(x) := x / (1 + x)^2. - Michael Somos, May 07 2015
Moebius transform of A186690. - Michael Somos, Apr 25 2015
a(n) = -(-1)^n * A186813(n). - Michael Somos, May 07 2015
a(n) = n*cos(n*Pi/2)/2-n*(-1)^n. - Wesley Ivan Hurt, May 05 2021
EXAMPLE
G.f. = x - 3*x^2 + 3*x^3 - 2*x^4 + 5*x^5 - 9*x^6 + 7*x^7 - 4*x^8 + 9*x^9 + ...
MATHEMATICA
Rest[CoefficientList[Series[x (1-x)^3(1-x^3)/(1-x^4)^2, {x, 0, 70}], x]] (* or *) LinearRecurrence[{-2, -3, -4, -3, -2, -1}, {1, -3, 3, -2, 5, -9}, 70] (* Harvey P. Dale, Aug 08 2012 *)
a[ n_] := n If[ OddQ[n], 1, -(Mod[n/2, 2] + 1/2)]; (* Michael Somos, Apr 25 2015 *)
a[ n_] := n {1, -3/2, 1, -1/2}[[Mod[n, 4, 1]]]; (* Michael Somos, Apr 25 2015 *)
PROG
(PARI) {a(n) = -(-1)^n * n * [1, 2, 3, 2] [n%4 + 1] / 2};
(PARI) {a(n) = sign(n) * polcoeff( x * (1 - x)^3 * (1 - x^3) / (1 - x^4)^2 + x * O(x^abs(n)), abs(n))};
(PARI) {a(n) = n * if( n%2, 1, -(n/2%2 + 1/2))}; /* Michael Somos, Apr 25 2015 */
(Magma) m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1-x)^3*(1-x^3)/(1-x^4)^2)); // G. C. Greubel, Aug 14 2018
CROSSREFS
KEYWORD
sign,mult,easy
AUTHOR
Michael Somos, Feb 13 2011
STATUS
approved