login
A280193
a(2*n) = 2, a(2*n + 1) = -1, a(0) = 1.
2
1, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2
OFFSET
0,3
FORMULA
Euler transform of length 6 sequence [-1, 2, 1, 0, 0, -1].
Moebius transform is length 2 sequence [-1, 3].
a(n) = -b(n) where b() is multiplicative with b(2^e) = -2 if e>0, b(p^e) = 1 otherwise.
G.f.: (1 - x + x^2) / (1 - x^2).
G.f.: (1 - x) * (1 - x^6) / ((1 - x^3) * (1 -x^2)^2).
G.f.: 1 / (1 + x / (1 + x / (1 - 3*x / (1 + x)))).
a(n) = (-1)^n * A040001(n).
A028242(n) = Sum_{k=0..n} a(k).
A117575(n+1) = Product_{k=0..n} a(k).
A000225(n-1) = Sum_{k=0..n} binomial(n, k) * a(k) if n>0.
A000325(n) = Sum_{k=0..n} binomial(n, k+1) * a(k) if n>0.
a(n) = Sum_{k=0..n} binomial(n, k) * (-1)^k * A083329(k).
A079583(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n.
a(n) = A168361(n+1), n>0. - R. J. Mathar, Jan 04 2017
EXAMPLE
G.f. = 1 - x + 2*x^2 - x^3 + 2*x^4 - x^5 + 2*x^6 - x^7 + 2*x^8 - x^9 + ...
MATHEMATICA
a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], -1, True, 2];
a[ n_] := SeriesCoefficient[ (1 - x + x^2) / (1 - x^2), {x, 0, n}];
PROG
(PARI) {a(n) = if( n<1, n==0, 2 - 3*(n%2))};
(PARI) {a(n) = if( n<1, n==0, [2, -1][n%2 + 1])};
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 - x + x^2) / (1 - x^2) + x * O(x^n), n))};
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x+x^2)/(1-x^2))); // G. C. Greubel, Jul 29 2018
KEYWORD
sign,easy
AUTHOR
Michael Somos, Dec 28 2016
STATUS
approved