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.

A122972 a(1) = 1, a(2) = 2; for n>2, a(n+1) = a(n)*(n-1) + a(n-1)*n.

Original entry on oeis.org

1, 2, 4, 14, 58, 302, 1858, 13262, 107698, 980942, 9905458, 109844942, 1327159858, 17353902542, 244180971058, 3678842132942, 59089527531058, 1007972756756942, 18199148360427058, 346736152866068942
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 21 2006

Keywords

Comments

a(n+2) - a(n) = 3*(n-1)*(n-1)! = A052673(n).

Programs

  • Haskell
    a122972 n = a122972_list !! (n-1)
    a122972_list = 1 : 2 : zipWith (+)
       (zipWith (*) [2..] a122972_list) (zipWith (*) [1..] $ tail a122972_list)
    -- Reinhard Zumkeller, Nov 15 2011
  • Mathematica
    RecurrenceTable[{a[1]==1,a[2]==2,a[n]==a[n-1](n-2)+a[n-2](n-1)}, a,{n,20}] (* Harvey P. Dale, Nov 02 2011 *)
    Table[2*(-1)^n-3*(-1)^n*Sum[(-1)^k*k!,{k,0,n-1}],{n,1,20}] (* Vaclav Kotesovec, Oct 28 2012 *)

Formula

a(n) = 2*(-1)^n - 3*(-1)^n*Sum_{k=0..n-1} (-1)^k*k!. - Vaclav Kotesovec, Oct 28 2012