OFFSET
0,2
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).
LINKS
T. D. Noe, Table of n, a(n) for n = 0..100
MAPLE
a := proc (n) option remember;
if n < 2 then n+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
t = {1, 2}; Do[AppendTo[t, n*(n-1)*t[[-1]]/2 + t[[-2]]], {n, 2, 20}] (* T. D. Noe, Jun 25 2012 *)
PROG
(PARI) a(n)=if(n<2, max(0, n+1), n*(n-1)*a(n-1)/2+a(n-2))
(Magma) I:=[1, 2]; [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
(Sage)
def a(n):
if (n<2): return n+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
(GAP) a:=[1, 2];; 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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Sep 19 2000
STATUS
approved