Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Oct 10 2023 05:05:04
%S 1,2,5,20,121,982,9933,120168,1692273,27196522,491229653,9851789564,
%T 217230600041,5223386190526,136025271553693,3813930989693904,
%U 114553954962370785,3669540489785558994,124878930607671376549,4499311042365955114724,171098698540513965736025
%N Sum of n-th antidiagonal of array in A144502.
%H Seiichi Manyama, <a href="/A144503/b144503.txt">Table of n, a(n) for n = 0..404</a>
%F a(n) ~ sqrt(Pi) * 2^(n - 1/2) * n^(n - 1/2) / exp(n-1). - _Vaclav Kotesovec_, Apr 06 2019
%F a(n) = 2*(n-1)*a(n-1) + a(n-2) - 2*(n-2), with a(0) = 1, a(1) = 2. - _G. C. Greubel_, Oct 09 2023
%t a[n_]:= a[n]= If[n<2, n+1, 2*(n-1)*a[n-1] +a[n-2] -2*(n-2)];
%t Table[a[n], {n,0,30}] (* _G. C. Greubel_, Oct 09 2023 *)
%o (Ruby)
%o def A144503(n)
%o ary = []
%o a = [1]
%o (n + 1).times{|i|
%o (1..i).each{|j|
%o a[j] *= i - j
%o a[j] += a[j - 1]
%o }
%o ary << a.inject(:+)
%o a << 0
%o }
%o ary
%o end
%o p A144503(20) # _Seiichi Manyama_, Apr 06 2019
%o (Magma) [n le 2 select n else 2*(n-2)*Self(n-1) +Self(n-2) -2*(n-3): n in [1..30]]; // _G. C. Greubel_, Oct 09 2023
%o (SageMath)
%o @CachedFunction
%o def a(n): # A144503
%o if (n<2): return n+1
%o else: return 2*(n-1)*a(n-1) + a(n-2) - 2*(n-2)
%o [a(n) for n in range(31)] # _G. C. Greubel_, Oct 09 2023
%Y Cf. A144502.
%K nonn
%O 0,2
%A _David Applegate_ and _N. J. A. Sloane_, Dec 13 2008