|
|
A001046
|
|
a(n) = n*(n-1)*a(n-1)/2 + a(n-2), a(0) = a(1) = 1.
(Formerly M1811 N0717)
|
|
3
|
|
|
1, 1, 2, 7, 44, 447, 6749, 142176, 3987677, 143698548, 6470422337, 356016927083, 23503587609815, 1833635850492653, 166884365982441238, 17524692064006822643, 2103129932046801158398, 286043195450428964364771, 43766712033847678348968361
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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;
|
|
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)
(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
|
|
|
STATUS
|
approved
|
|
|
|