cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A098178 Expansion of (1+x)(1-x+x^2)/((1-x)(1+x^2)).

Original entry on oeis.org

1, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2
Offset: 0

Views

Author

Paul Barry, Aug 30 2004

Keywords

Comments

Transform of A011782 under the Chebyshev mapping g(x)-> ((1-x^2)/(1+x^2)) * g(x/(1+x^2)).
Binomial transform is A098179.
Multiplicative with a(2) = 0, a(2^e) = 2 if e >= 2, a(p^e) = 1. [David W. Wilson, Jun 12 2005]
1, followed by period 4, repeat [1, 0, 1, 2]. [Joerg Arndt, Jan 06 2014]

Crossrefs

Programs

  • Magma
    [1] cat &cat [[1, 0, 1, 2]^^30]; // Wesley Ivan Hurt, Jul 07 2016
  • Maple
    with(numtheory); A098178:=n->signum(n)-1+sqrt((n-2)^2 mod 8); seq(A098178(n), n=0..100); # Wesley Ivan Hurt, Jan 04 2014
  • Mathematica
    CoefficientList[Series[(1+x)(1-x+x^2)/((1-x)(1+x^2)),{x,0,120}],x] (* or *) PadRight[{1},120,{2,1,0,1}] (* Harvey P. Dale, May 01 2013 *)
    Table[Sign[n] - 1 + Sqrt[Mod[(n - 2)^2, 8]], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 04 2014 *)
    Join[{1},LinearRecurrence[{1, -1, 1},{1, 0, 1},104]] (* Ray Chandler, Sep 03 2015 *)

Formula

G.f.: (1+x)(1-x+x^2)/((1-x)(1+x^2)).
a(n) = 1 + cos(Pi*n/2) - 0^n.
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
a(n) = A007877(n+2), n>0. Dirichlet g.f. (1-1/2^s+2/4^s)*zeta(s). - R. J. Mathar, Feb 24 2011
a(n) = sign(n) - 1 + sqrt((n-2)^2 mod 8). - Wesley Ivan Hurt, Jan 04 2014
a(n) = a(n-4) for n>4. - Wesley Ivan Hurt, Jul 07 2016
E.g.f.: exp(x) + cos(x) - 1. - Ilya Gutkovskiy, Jul 07 2016