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.

A102038 a(n+1) = n*a(n) + a(n-1), a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 5, 17, 73, 382, 2365, 16937, 137861, 1257686, 12714721, 141119617, 1706150125, 22321071242, 314201147513, 4735338283937, 76079613690505, 1298088771022522, 23441677492095901, 446689961120844641
Offset: 1

Views

Author

Eric Angelini, Feb 12 2005

Keywords

Comments

a(n) = x(n) + y(n) where x(n)/y(n) is the continued fraction [1,2,3,4,...,n].
Using a(n) = x(n) - y(n) instead of a(n) = x(n) + y(n) would give A058307.

Crossrefs

Numerators are in A001040 and denominators in A001053.
Cf. A124428.

Programs

  • GAP
    a:=[1,2];; for n in [3..30] do a[n]:=(n-1)*a[n-1]+a[n-2]; od; a; # G. C. Greubel, Feb 23 2019
  • Magma
    I:=[1,2]; [n le 2 select I[n] else (n-1)*Self(n-1) +Self(n-2): n in [1..30]]; // G. C. Greubel, Feb 23 2019
    
  • Mathematica
    a[1]= 1; a[2]= 2; a[n_]:= a[n] = (n-1)*a[n-1]+a[n-2]; Table[a[n], {n,20}] (* Robert G. Wilson v, Feb 14 2005 *)
    RecurrenceTable[{a[1]==1,a[2]==2,a[n+1]==n*a[n]+a[n-1]},a,{n,20}] (* Harvey P. Dale, Sep 04 2018 *)
  • PARI
    a(n)=sum(k=0,n,k!*binomial((n+k)\2,k)*binomial((n+k+1)\2,k)) \\ Paul D. Hanna, Oct 31 2006
    
  • Sage
    [sum(factorial(k)*binomial(floor((n+k-1)/2), k)*binomial(floor((n+k)/2), k) for k in (0..n)) for n in (1..30)] # G. C. Greubel, Feb 23 2019
    

Formula

a(n) = A001040(n) + A001053(n) for n>1.
From Paul D. Hanna, Oct 31 2006: (Start)
a(n+1) = Sum_{k=0..n} k!*C(floor((n+k)/2),k)*C(floor((n+k+1)/2),k).
a(n+1) = Sum_{k=0..n} k!*A124428(n+k,k). (End)

Extensions

Edited and extended by Robert G. Wilson v, Feb 14 2005