OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..2500
Michael Somos, Rational Function Multiplicative Coefficients.
Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
FORMULA
Euler transform of length 10 sequence [-2, 2, 1, 2, 1, -1, 0, 0, 0, -1].
a(n) is multiplicative with a(2) = -2, a(2^e) = -3*2^(e-2) if e>1, a(p^e) = p^e otherwise.
For nonnegative n, |a(n)| counts the distinct differences of perfect squares (mod n).
G.f.: -f(-x) + f(x^4) where f(x) := x / (1 - x)^2.
G.f.: x * (1 + x^3) * (1 + x^5) / ((1 + x) * (1 - x^4))^2.
a(n) = -a(-n) for all n in Z.
From Amiram Eldar, Dec 29 2022: (Start)
Dirichlet g.f.: zeta(s-1)*(1-2^(2-s)+4^(-s)).
Sum_{k=1..n} a(k) ~ n^2/32. (End)
EXAMPLE
G.f. = x - 2*x^2 + 3*x^3 - 3*x^4 + 5*x^5 - 6*x^6 + 7*x^7 - 6*x^8 + 9*x^9 + ...
MATHEMATICA
a[ n_] := n {1, -1, 1, -3/4}[[Mod[ n, 4, 1]]];
a[ n_] := n If[ Divisible[ n, 4], -3/4, -(-1)^n];
CoefficientList[Series[x*(1+x^3)*(1+x^5)/((1+x)*(1-x^4))^2, {x, 0, 60}], x] (* G. C. Greubel, Aug 02 2018 *)
PROG
(PARI) {a(n) = n * [-3/4, 1, -1, 1][n%4 + 1]};
(PARI) {a(n) = n * if( n%4, -(-1)^n, -3/4)};
(PARI) my(x='x+O('x^60)); Vec(x*(1+x^3)*(1+x^5)/((1+x)*(1-x^4))^2) \\ G. C. Greubel, Aug 02 2018
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x * (1+x^3)*(1+x^5)/((1+x)*(1-x^4))^2)); // G. C. Greubel, Aug 02 2018
CROSSREFS
KEYWORD
sign,mult,easy
AUTHOR
Michael Somos, May 05 2015
STATUS
approved