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.

A001046 a(n) = n*(n-1)*a(n-1)/2 + a(n-2), a(0) = a(1) = 1.

Original entry on oeis.org

1, 1, 2, 7, 44, 447, 6749, 142176, 3987677, 143698548, 6470422337, 356016927083, 23503587609815, 1833635850492653, 166884365982441238, 17524692064006822643, 2103129932046801158398, 286043195450428964364771, 43766712033847678348968361
Offset: 0

Views

Author

Keywords

Examples

			a(4) = 4*3*7/2 + 2 = 44.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001052.

Programs

  • GAP
    a:=[1,1];; for n in [3..20] do a[n]:=Binomial(n-1,2)*a[n-1]+a[n-2]; od; a; # G. C. Greubel, Sep 20 2019
  • Magma
    I:=[1,1]; [n le 2 select I[n] else Binomial(n-1,2)*Self(n-1) + Self(n-2): n in [1..20]]; // G. C. Greubel, Sep 20 2019
    
  • Maple
    a := proc (n) option remember;
    if n < 2 then 1
    else binomial(n,2)*a(n-1)+a(n-2) fi;
    end proc;
    seq(a(n), n = 0..20); # G. C. Greubel, Sep 20 2019
  • Mathematica
    RecurrenceTable[{a[0]==a[1]==1,a[n]==n(n-1) a[n-1]/2+a[n-2]}, a[n], {n,20}] (* Harvey P. Dale, Sep 07 2011 *)
    t = {1, 1}; Do[AppendTo[t, n*(n-1)*t[[-1]]/2 + t[[-2]]], {n, 2, 20}] (* T. D. Noe, Jun 25 2012 *)
  • PARI
    m=20; v=concat([1,1], vector(m-2)); for(n=3, m, v[n]=binomial(n-1, 2)*v[n-1] + v[n-2] ); v \\ G. C. Greubel, Sep 20 2019
    
  • Sage
    def a(n):
        if (n<2): return 1
        else: return binomial(n,2)*a(n-1)+a(n-2)
    [a(n) for n in (0..20)] # G. C. Greubel, Sep 20 2019
    

Extensions

More terms from James Sellers, Oct 05 2000