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.

A084099 Expansion of (1+x)^2/(1+x^2).

Original entry on oeis.org

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

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Inverse binomial transform of A077860. Partial sums of A084100.
Transform of sqrt(1+2x)/sqrt(1-2x) (A063886) under the Chebyshev transformation A(x)->((1-x^2)/(1+x^2))*A(x/(1+x^2)). - Paul Barry, Oct 12 2004
Euler transform of length 4 sequence [2, -3, 0, 1]. - Michael Somos, Aug 04 2009

Examples

			G.f. = 1 + 2*x - 2*x^3 + 2*x^5 - 2*x^7 + 2*x^9 - 2*x^11 + 2*x^13 - 2*x^15 + ...
		

Crossrefs

Programs

  • Magma
    [1] cat [Integers()!((1-(-1)^n)*(-1)^(n*(n-1)/2)): n in [1..100]]; // Wesley Ivan Hurt, Oct 27 2015
    
  • Maple
    A084099:=n->(1-(-1)^n)*(-1)^((2*n-1+(-1)^n)/4): 1,seq(A084099(n), n=1..100); # Wesley Ivan Hurt, Oct 27 2015
  • Mathematica
    CoefficientList[Series[(1+x)^2/(1+x^2),{x,0,110}],x] (* or *) Join[ {1}, PadRight[{},120,{2,0,-2,0}]] (* Harvey P. Dale, Nov 23 2011 *)
  • PARI
    {a(n) = if( n<1, n==0, 2 * if( n%2, (-1)^(n\2)) )}; /* Michael Somos, Aug 04 2009 */
    
  • PARI
    a(n) = if(n==0, 1, I*((-I)^n-I^n)) \\ Colin Barker, Oct 27 2015
    
  • PARI
    Vec((1+x)^2/(1+x^2) + O(x^100)) \\ Colin Barker, Oct 27 2015

Formula

G.f.: (1+x)^2/(1+x^2).
a(n) = 2 * A101455(n) for n>0. - N. J. A. Sloane, Jun 01 2010
a(n+2) = (-1)^A180969(1,n)*((-1)^n - 1). - Adriano Caroli, Nov 18 2010
G.f.: 4*x + 2/(1+x)/G(0), where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 19 2013
From Wesley Ivan Hurt, Oct 27 2015: (Start)
a(n) = (1-sign(n)*(-1)^n)*(-1)^floor(n/2).
a(n) = 2*(n mod 2)*(-1)^floor(n/2) for n>0, a(0)=1.
a(n) = (1-(-1)^n)*(-1)^(n*(n-1)/2) for n>0, a(0)=1. (End)
From Colin Barker, Oct 27 2015: (Start)
a(n) = -a(n-2).
a(n) = i*((-i)^n-i^n) for n>0, where i = sqrt(-1).
(End)

A280560 a(n) = (-1)^n * 2 if n!=0, with a(0) = 1.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jan 05 2017

Keywords

Examples

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

Crossrefs

Programs

  • Magma
    [n eq 0 select 1 else 2*(-1)^n: n in [0..75]]; // G. C. Greubel, Jul 29 2018; Mar 28 2024
    
  • Mathematica
    a[ n_] := (-1)^n (2 - Boole[n == 0]);
    PadRight[{1},120,{2,-2}] (* Harvey P. Dale, Jun 04 2019 *)
  • PARI
    {a(n) = (-1)^n * if(n, 2, 1)};
    
  • SageMath
    [2*(-1)^n -int(n==0) for n in range(76)] # G. C. Greubel, Mar 28 2024

Formula

Euler transform of length 2 sequence [-2, 1].
Moebius transform is length 2 sequence [-2, 4].
a(n) = -2*A033999(n) if n!=0.
G.f.: (1 - x) / (1 + x) = 1 / (1 + 2*x / (1 - x)) = 1 - 2*x / (1 + x).
E.g.f.: 2*exp(-x) - 1.
a(n) = a(-n) for all n in Z.
a(n) = A084100(2*n) = A084100(2*n + 1), if n>=0.
a(n) = (-1)^n * A040000(n).
a(2*n) = A040000(n).
Convolution inverse is A040000.

A018840 Number of steps for {2,3} fairy knight to reach (n,0) on infinite chessboard.

Original entry on oeis.org

0, 5, 4, 5, 2, 5, 2, 5, 4, 5, 4, 7, 4, 5, 6, 7, 6, 7, 6, 7, 8, 9, 8, 9, 8, 9, 10, 11, 10, 11, 10, 11, 12, 13, 12, 13, 12, 13, 14, 15, 14, 15, 14, 15, 16, 17, 16, 17, 16, 17, 18, 19, 18, 19, 18, 19, 20, 21, 20, 21, 20, 21, 22, 23, 22, 23, 22, 23, 24, 25, 24, 25, 24, 25, 26, 27, 26, 27, 26, 27
Offset: 0

Views

Author

Keywords

Comments

This piece is also known as a (2,3)-leaper or a zebra. - Franklin T. Adams-Watters, Dec 27 2017
Apparently also the minimum number of moves of the (1,5)-leaper to reach (n,n) starting from (0,0). - R. J. Mathar, Jan 05 2018

Programs

  • PARI
    concat(0, Vec(x*(5 - x + x^2 - 3*x^3 + 3*x^4 - 3*x^5 - 2*x^6 + 2*x^9 - 2*x^12 + 2*x^13 - 2*x^16 + 2*x^17) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)) + O(x^100))) \\ Colin Barker, Dec 28 2017

Formula

For n >= 18, a(n) = a(n-6) + 2. - David W. Wilson
From Colin Barker, Dec 28 2017: (Start)
G.f.: x*(5 - x + x^2 - 3*x^3 + 3*x^4 - 3*x^5 - 2*x^6 + 2*x^9 - 2*x^12 + 2*x^13 - 2*x^16 + 2*x^17) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)).
a(n) = a(n-1) + a(n-6) - a(n-7) for n>7.
(End)
3*a(n) = A004442(n+3)-A084100(n), n>11. - R. J. Mathar, Jan 02 2018

A216178 Period 4: repeat [4, 1, 0, -3].

Original entry on oeis.org

4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3, 4, 1, 0, -3
Offset: 0

Views

Author

Brad Clardy, Mar 10 2013

Keywords

Crossrefs

Programs

  • Magma
    for n in [0 .. 50] do (3*(-1)^n+1)/2 + 2*(-1)^((2*n-1+(-1)^n)/4); end for;
    
  • Magma
    &cat [[4, 1, 0, -3]^^30]; // Wesley Ivan Hurt, Jul 09 2016
    
  • Maple
    seq(op([4, 1, 0, -3]), n=0..40); # Wesley Ivan Hurt, Jul 09 2016
  • Mathematica
    PadRight[{},100,{4,1,0,-3}] (* or *) LinearRecurrence[{0,0,0,1},{4,1,0,-3},100] (* Harvey P. Dale, Nov 28 2014 *)
  • PARI
    a(n)=[4, 1, 0, -3][n%4+1] \\ Charles R Greathouse IV, Jul 17 2016

Formula

a(n) = (3*(-1)^n+1)/2 + 2*(-1)^((2*n-1+(-1)^n)/4).
a(n) = A168361(n+1) + A084100(n+4).
G.f.: (4+x-3*x^3) / ((1-x)*(1+x)*(1+x^2)). - R. J. Mathar, Mar 10 2013
a(n+4) = a(n). - Alexander R. Povolotsky, Mar 15 2013
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = 1/2+3*I^(2*n)/2+(1+I)*I^(-n)+(1-I)*I^n.
a(n) = (1+3*cos(n*Pi)+4*cos(n*Pi/2)+4*sin(n*Pi/2)+3*I*sin(n*Pi))/2. (End)
Showing 1-4 of 4 results.