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-3 of 3 results.

A122584 Expansion of x*(1+x)*(1-2*x)/(1 - 2*x - x^2 + 2*x^3 - x^4).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 9, 19, 41, 87, 186, 396, 845, 1801, 3841, 8189, 17462, 37232, 79389, 169275, 360937, 769603, 1640982, 3498968, 7460649, 15907905, 33919505, 72324585, 154213514, 328820508, 701124865, 1494967795, 3187632953
Offset: 1

Views

Author

Roger L. Bagula, Sep 19 2006

Keywords

References

  • A. Messiah, Quantum mechanics, vol. 2, pp. 608-609, eq.(XIV.57), North Holland, 1969.

Crossrefs

Programs

  • Magma
    [n le 5 select 1 else 2*Self(n-1) +Self(n-2) -2*Self(n-3) +Self(n-4): n in [1..50]]; // G. C. Greubel, Nov 28 2021
    
  • Maple
    seq(coeff(series((x*(1+x)*(2*x-1))/(x^4-2*x^3+x^2+2*x-1),x,n+1), x, n), n = 1 .. 40); # Muniru A Asiru, Jan 03 2019
  • Mathematica
    a[n_]:= a[n]= If[n<4, 1, 2*a[n-1] +a[n-2] -2*a[n-3] +a[n-4]];
    Table[a[n], {n, 50}] (* modified by G. C. Greubel, Nov 28 2021 *)
  • PARI
    Vec(x*(1+x)*(2*x-1)/(-1+2*x+x^2-2*x^3+x^4)+O(x^99)) \\ Charles R Greathouse IV, Sep 27 2012
    
  • Sage
    @CachedFunction # a=A122584
    def a(n): return 1 if (n<5) else 2*a(n-1) +a(n-2) -2*a(n-3) +a(n-4)
    [a(n) for n in (1..50)] # G. C. Greubel, Nov 28 2021

Formula

G.f.: x*(1+x)*(1-2*x)/(1 - 2*x - x^2 + 2*x^3 - x^4).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) + a(n-4).

A122581 a(n) = a(n - 1) - 2*a(n - 2) + a(n - 3) - 4*a(n - 4) + 2*a(n - 5).

Original entry on oeis.org

1, 1, 1, 1, 1, -2, -5, -2, 4, 13, 19, -5, -50, -65, -20, 118, 283, 187, -311, -914, -1001, 334, 3040, 4405, 835, -8273, -17030, -11189, 20068, 60178, 60427, -29165, -192491, -274310, -39845, 553798, 1070812, 635629, -1341437, -3836765, -3693914, 2237287, 12425356, 16921054, 1409755, -36343973
Offset: 1

Views

Author

Roger L. Bagula, Sep 19 2006

Keywords

Comments

This recursion is inspired by Ulam's early experiments in derivative recursions.

Crossrefs

Programs

  • Maple
    A122581:= proc(n) option remember; if n <= 5 then 1; else A122581(n-1) -2*A122581(n-2)+A122581(n-3)+2*(-2*A122581(n-4)+A122581(n-5)); fi; end: seq(A122581(n),n=1..50) ; # R. J. Mathar, Sep 18 2007
  • Mathematica
    a[n_]:= a[n]= If[n<6, 1, a[n-1] -2*a[n-2] +a[n-3] -2*(2*a[n-4] -a[n-5])];
    Table[a[n], {n,50}]
  • Sage
    @CachedFunction # a=A122581
    def a(n): return 1 if (n<6) else a(n-1) -2*a(n-2) +a(n-3) -4*a(n-4) +2*a(n-5)
    [a(n) for n in (1..50)] # G. C. Greubel, Nov 28 2021

Formula

G.f.: x*(1+2*x^2+x^3+5*x^4)/(1-x+2*x^2-x^3+4*x^4-2*x^5). - R. J. Mathar, Nov 18 2007

Extensions

Edited by N. J. A. Sloane, Oct 01 2006
More terms from R. J. Mathar, Sep 18 2007

A122582 a(n) = a(n - 1) - 2*a(n - 2) + a(n - 3) - 2*a(n - 4) + a(n - 5).

Original entry on oeis.org

1, 1, 1, 1, 1, -1, -3, -1, 3, 5, 3, -5, -13, -7, 13, 27, 15, -25, -61, -37, 57, 135, 81, -119, -297, -191, 257, 661, 431, -549, -1455, -991, 1169, 3225, 2257, -2497, -7115, -5145, 5299, 15725, 11715, -11261, -34709, -26623, 23829, 76603, 60479, -50361, -168997, -137173, 106105, 372655, 310905, -222951
Offset: 1

Views

Author

Roger L. Bagula, Sep 19 2006

Keywords

Comments

This recursion is inspired by Ulam's early experiments in derivative recursions.

Crossrefs

Programs

  • Magma
    [n le 5 select 1 else Self(n-1) -2*Self(n-2) +Self(n-3) -2*Self(n-4) +Self(n-5): n in [1..50]]; // G. C. Greubel, Nov 28 2021
    
  • Mathematica
    a[n_]:= a[n]= If[n<6, 1, a[n-1] -2*a[n-2] +a[n-3] -2*a[n-4] +a[n-5]];
    Table[a[n], {n, 60}]
    Transpose[NestList[Flatten[{Rest[#],ListCorrelate[{1,-2,1,-2,1},#]}]&, {1,1,1,1,1},60]][[1]]  (* Harvey P. Dale, Mar 21 2011 *)
  • Sage
    @CachedFunction # a=A122582
    def a(n): return 1 if (n<6) else a(n-1) -2*a(n-2) +a(n-3) -2*a(n-4) +a(n-5)
    [a(n) for n in (1..50)] # G. C. Greubel, Nov 28 2021

Formula

G.f.: x*(1+2*x^2+x^3+3*x^4)/(1-x+2*x^2-x^3+2*x^4-x^5). - R. J. Mathar, May 12 2013

Extensions

Edited by N. J. A. Sloane, Oct 01 2006, Jan 01 2007
Showing 1-3 of 3 results.