OFFSET
0,3
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
R. K. Guy, Letters to N. J. A. Sloane, June-August 1968
EXAMPLE
a(4) = 4*3*7/2 + 2 = 44.
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 *)
PROG
(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
(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
(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
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Oct 05 2000
STATUS
approved