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.

A144503 Sum of n-th antidiagonal of array in A144502.

Original entry on oeis.org

1, 2, 5, 20, 121, 982, 9933, 120168, 1692273, 27196522, 491229653, 9851789564, 217230600041, 5223386190526, 136025271553693, 3813930989693904, 114553954962370785, 3669540489785558994, 124878930607671376549, 4499311042365955114724, 171098698540513965736025
Offset: 0

Views

Author

David Applegate and N. J. A. Sloane, Dec 13 2008

Keywords

Crossrefs

Cf. A144502.

Programs

  • 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
    
  • 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 *)
  • 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
    
  • 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

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