login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193690 Expansion of (1 - x^2)^2 * (1 - x^4) / ((1 - x)^2 * (1 - x^6)) in powers of x. 1
1, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2, 0, 2, 1, 0, -1, -2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
Euler transform of length 6 sequence [2, -2, 0, -1, 0, 1].
a(n) = 2*b(n) where b(n) is multiplicative with b(2^e) = -(-1)^e / 2 if e>0, b(3^e) = 0^e, b(p^e) = 1 if p == 1 (mod 6), b(p^e) = (-1)^e if p == 5 (mod 6).
G.f.: (1 - x^2)^2 * (1 - x^4) / ((1 - x)^2 * (1 - x^6)) = (1 + x)^2 * (1 + x^2) / ((1 - x + x^2) * (1 + x + x^2)).
a(3*n) = 0 unless n = 0. a(-n) = -a(n) unless n = 0. a(n + 6) = a(n) unless n = 0.
EXAMPLE
G.f. = 1 + 2*x + x^2 - x^4 - 2*x^5 + 2*x^7 + x^8 - x^10 - 2*x^11 + 2*x^13 + ...
MATHEMATICA
a[ n_] := Boole[n == 0] + {0, 2, 1, 0, -1, 2} [[ Mod[n, 6] + 1]]
CoefficientList[Series[(1-x^2)^2*(1-x^4)/((1-x)^2*(1-x^6)), {x, 0, 50}], x] (* G. C. Greubel, Aug 13 2018 *)
PROG
(PARI) {a(n) = (n==0) + [0, 2, 1, 0, -1, -2][n%6 + 1]}
(PARI) {a(n) = my(A, p, e); if( n==0, 1, A = factor(n); 2 * sign(n) * prod( k=1, matsize(A)[1], if( p = A[k, 1], e = A[k, 2]; if( p==2, -(-1)^e / 2, if( p==3, 0, if( p%6==1, 1, (-1)^e))))))}
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x^2)^2*(1-x^4)/((1-x)^2*(1-x^6)))); // _G. c. Greubel_, Aug 13 2018
CROSSREFS
Sequence in context: A069850 A141581 A179286 * A108964 A036581 A369462
KEYWORD
sign,easy
AUTHOR
Michael Somos, Aug 02 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)