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.

This page as a plain text file.
%I A001046 M1811 N0717 #37 Jul 02 2025 16:01:54
%S A001046 1,1,2,7,44,447,6749,142176,3987677,143698548,6470422337,356016927083,
%T A001046 23503587609815,1833635850492653,166884365982441238,
%U A001046 17524692064006822643,2103129932046801158398,286043195450428964364771,43766712033847678348968361
%N A001046 a(n) = n*(n-1)*a(n-1)/2 + a(n-2), a(0) = a(1) = 1.
%D A001046 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A001046 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A001046 T. D. Noe, <a href="/A001046/b001046.txt">Table of n, a(n) for n = 0..100</a>
%H A001046 R. K. Guy, <a href="/A002186/a002186.pdf">Letters to N. J. A. Sloane, June-August 1968</a>
%e A001046 a(4) = 4*3*7/2 + 2 = 44.
%p A001046 a := proc (n) option remember;
%p A001046 if n < 2 then 1
%p A001046 else binomial(n,2)*a(n-1)+a(n-2) fi;
%p A001046 end proc;
%p A001046 seq(a(n), n = 0..20); # _G. C. Greubel_, Sep 20 2019
%t A001046 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 A001046 t = {1, 1}; Do[AppendTo[t, n*(n-1)*t[[-1]]/2 + t[[-2]]], {n, 2, 20}] (* _T. D. Noe_, Jun 25 2012 *)
%o A001046 (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
%o A001046 (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
%o A001046 (Sage)
%o A001046 def a(n):
%o A001046     if (n<2): return 1
%o A001046     else: return binomial(n,2)*a(n-1)+a(n-2)
%o A001046 [a(n) for n in (0..20)] # _G. C. Greubel_, Sep 20 2019
%o A001046 (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
%Y A001046 Cf. A001052.
%K A001046 nonn,easy
%O A001046 0,3
%A A001046 _N. J. A. Sloane_
%E A001046 More terms from _James Sellers_, Oct 05 2000