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.

Showing 1-4 of 4 results.

A109265 Row sums of Riordan array (1-x-x^2,x(1-x)).

Original entry on oeis.org

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

Views

Author

Paul Barry, Jun 24 2005

Keywords

Examples

			G.f. = 1 - 2*x^2 - 2*x^3 + 2*x^5 + 2*x^6 - 2*x^8 - 2*x^9 + 2*x^11 + 2*x^12 + ...
		

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x-x^2)/(1-x+x^2))); // G. C. Greubel, Aug 04 2018
  • Mathematica
    CoefficientList[Series[(1-x-x^2)/(1-x+x^2), {x, 0, 60}], x] (* G. C. Greubel, Aug 04 2018 *)
    LinearRecurrence[{1,-1},{1,0,-2},120] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    {a(n) = n+=2; if( n<3, n==2, 2 * (n%3>0) * (-1)^(n\3))}; /* Michael Somos, Apr 15 2015 */
    

Formula

G.f.: (1-x-x^2)/(1-x+x^2).
a(n) = -a(n+3) if n>0. - Michael Somos, Apr 15 2015
a(n) = A257076(n+1). - Michael Somos, Apr 15 2015
Convolution inverse of A006355. - Michael Somos, Apr 15 2015
a(n) = A130772(n+1) = A184334(n+2) if n>0. - Michael Somos, Sep 01 2015

A130772 Periodic sequence with period 2 2 0 -2 -2 0.

Original entry on oeis.org

2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2
Offset: 0

Views

Author

Paul Curtz, Jul 14 2007

Keywords

Comments

Sequence is identical to its third differences.

Examples

			G.f. = 2 + 2*x - 2*x^3 - 2*x^4 + 2*x^6 + 2*x^7 - 2*x^9 - 2*x^10 + ...
		

Crossrefs

Programs

  • Magma
    I:=[2,2]; [n le 2 select I[n] else Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Aug 04 2018
  • Mathematica
    PadRight[{},120,{2,2,0,-2,-2,0}] (* or *) LinearRecurrence[{1,-1},{2,2},120] (* Harvey P. Dale, Jan 13 2014 *)
  • PARI
    for(i=1,9,print1("2, 2, 0, -2, -2, 0, ")) \\ Charles R Greathouse IV, Jun 02 2011
    

Formula

O.g.f.: 2/(x^2-x+1). a(n) = 2*A010892(n) . - R. J. Mathar, Feb 14 2008
a(0)=2, a(1)=2, a(n)=a(n-1)-a(n-2). - Harvey P. Dale, Jan 13 2014
a(n) = A184334(n+1) if n>=0. a(n) = A109265(n-1) = A257076(n) if n>1. - Michael Somos, Sep 01 2015

A184334 Period 6 sequence [0, 2, 2, 0, -2, -2, ...] except a(0) = 1.

Original entry on oeis.org

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

Views

Author

Michael Somos, Feb 13 2011

Keywords

Examples

			G.f. = 1 + 2*x + 2*x^2 - 2*x^4 - 2*x^5 + 2*x^7 + 2*x^8 - 2*x^10 - 2*x^11 + ...
		

Crossrefs

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x+x^2)/(1-x+x^2))); // G. C. Greubel, Aug 04 2018
  • Mathematica
    PadRight[{1},120,{0,2,2,0,-2,-2}] (* Harvey P. Dale, Apr 02 2015 *)
    a[ n_] := Boole[n == 0] + {2, 2, 0, -2, -2, 0}[[Mod[n, 6, 1]]]; (* Michael Somos, Sep 01 2015 *)
  • PARI
    {a(n) = (n==0) + [ 0, 2, 2, 0, -2, -2][n%6+1]};
    
  • PARI
    {a(n) = (n==0) + 2 * (-1)^(n\3) * sign( n%3)};
    

Formula

a(n) = 2 * b(n) where b() is multiplicative with b(2^e) = (-1)^(e-1) 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.
Euler transform of length 6 sequence [2, -1, -2, 0, 0, 1].
G.f. A(x) satisfies 0 = f(A(x), A(x^2)) where f(u, v) = 2 * u * (v - 1) - (u - 1)^2 * v.
G.f.: (1 + x + x^2) / (1 - x + x^2).
a(-n) = -a(n) unless n = 0. a(n+3) = -a(n) unless n = 0 or n = -3.
G.f.: 1 / (1 - 2*x / (1 + x / (1 - x / (1 + x)))). - Michael Somos, Jan 03 2013
a(n) = A130772(n-1) if n>0.
a(n) = A257076(n-1) = A109265(n-2) if n>2. - Michael Somos, Sep 01 2015

A257075 a(n) = (-1)^(n mod 3).

Original entry on oeis.org

1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1
Offset: 0

Views

Author

Michael Somos, Apr 15 2015

Keywords

Comments

Period 3: repeat [1, -1, 1]. - Wesley Ivan Hurt, Jul 02 2016

Examples

			G.f. = 1 - x + x^2 + x^3 - x^4 + x^5 + x^6 - x^7 + x^8 + x^9 - x^10 + ...
G.f. = q - q^3 + q^5 + q^7 - q^9 + q^11 + q^13 - q^15 + q^17 + q^19 + ...
		

Crossrefs

Essentially the same as A131561.

Programs

  • Magma
    [(-1)^(n mod 3) : n in [0..100]]; // Wesley Ivan Hurt, Jul 02 2016
  • Maple
    A257075:=n->(-1)^(n mod 3): seq(A257075(n), n=0..100); # Wesley Ivan Hurt, Jul 02 2016
  • Mathematica
    a[ n_] := (-1)^Mod[n, 3]; Table[a[n], {n, 0, 100}]
    LinearRecurrence[{0,0,1},{1,-1,1},80] (* or *) PadRight[{},100,{1,-1,1}] (* Harvey P. Dale, May 25 2023 *)
  • PARI
    {a(n) = (-1)^(n%3)};
    
  • PARI
    {a(n) = 1 - 2 * (n%3 == 1)};
    
  • PARI
    {a(n) = [1, -1, 1][n%3 + 1]};
    
  • PARI
    {a(n) = my(A, p, e); n = abs(2*n + 1); A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k,]; if( p==2, 0, p==3, -1, 1))};
    

Formula

Euler transform of length 6 sequence [-1, 1, 2, 0, 0, -1].
a(n) = b(2*n + 1) where b() is multiplicative with b(2^e) = 0^e, b(3^e) = -1 if e>0, otherwise b(p^e) = 1.
a(n) = a(-1-n) = a(n+3) = -a(n-1)*a(n-2) for all n in Z.
G.f.: (1 - x + x^2) / (1 - x^3).
G.f.: (1 - x) * (1 - x^6) / ((1 - x^2) * (1 - x^3)^2).
G.f.: 1 / (1 + x / (1 + 2*x^2 / (1 - x / (1 - x / (1 + x))))).
Given g.f. A(x), then x*A(x^2) = Sum_{k>0} (x^k - x^(2*k)) - 2*(x^(3*k) - x^(6*k)).
a(n) = A131561(n+1) for all n in Z.
a(n) = (-1)^n * A130151(n) for all n in Z.
Convolution inverse is A257076.
PSUM transform is A008611.
BINOMIAL transform is A086953.
1 / (1 - a(0)*x / (1 - a(1)*x / (1 - a(2)*x / ...))) is the g.f. of A168505.
From Wesley Ivan Hurt, Jul 02 2016: (Start)
a(n) = (1 + 2*cos(2*n*Pi/3) - 2*sqrt(3)*sin(2*n*Pi/3))/3.
a(n) = 2*sgn((n+2) mod 3) - 1. (End)
E.g.f.: (exp(3*x/2) + 4*sin(Pi/6-sqrt(3)*x/2))*exp(-x/2)/3. - Ilya Gutkovskiy, Jul 02 2016
Showing 1-4 of 4 results.