login

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”).

A144503
Sum of n-th antidiagonal of array in A144502.
7
1, 2, 5, 20, 121, 982, 9933, 120168, 1692273, 27196522, 491229653, 9851789564, 217230600041, 5223386190526, 136025271553693, 3813930989693904, 114553954962370785, 3669540489785558994, 124878930607671376549, 4499311042365955114724, 171098698540513965736025
OFFSET
0,2
LINKS
FORMULA
a(n) ~ sqrt(Pi) * 2^(n - 1/2) * n^(n - 1/2) / exp(n-1). - Vaclav Kotesovec, Apr 06 2019
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
MATHEMATICA
a[n_]:= a[n]= If[n<2, n+1, 2*(n-1)*a[n-1] +a[n-2] -2*(n-2)];
Table[a[n], {n, 0, 30}] (* G. C. Greubel, Oct 09 2023 *)
PROG
(Ruby)
def A144503(n)
ary = []
a = [1]
(n + 1).times{|i|
(1..i).each{|j|
a[j] *= i - j
a[j] += a[j - 1]
}
ary << a.inject(:+)
a << 0
}
ary
end
p A144503(20) # Seiichi Manyama, Apr 06 2019
(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
(SageMath)
@CachedFunction
def a(n): # A144503
if (n<2): return n+1
else: return 2*(n-1)*a(n-1) + a(n-2) - 2*(n-2)
[a(n) for n in range(31)] # G. C. Greubel, Oct 09 2023
CROSSREFS
Cf. A144502.
Sequence in context: A288841 A009599 A112833 * A012321 A012519 A076795
KEYWORD
nonn
AUTHOR
STATUS
approved