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.

A215096 a(0)=0, a(1)=1, a(n) = n! - a(n-2).

Original entry on oeis.org

0, 1, 2, 5, 22, 115, 698, 4925, 39622, 357955, 3589178, 39558845, 475412422, 6187461955, 86702878778, 1301486906045, 20836087009222, 354385941189955, 6381537618718778, 121290714467642045, 2426520470557921222, 50969651457241797955, 1121574207307049758778
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Crossrefs

Cf. A000142.
Cf. A005165: a(0) = 0, a(n) = n! - a(n-1).

Programs

  • Maple
    a:= proc(n) a(n):= `if`(n<2, n, n! - a(n-2)) end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Jun 04 2021
  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,(n+1)!-a}; NestList[nxt,{1,0,1},30][[;;,2]] (* Harvey P. Dale, Feb 15 2024 *)
  • Python
    prpr = 0
    prev = f = 1
    for n in range(2, 33):
        print(prpr, end=', ')
        f *= n
        curr = f - prpr
        prpr = prev
        prev = curr

Formula

D-finite with recurrence a(n) -n*a(n-1) +a(n-2) -n*a(n-3)=0. - R. J. Mathar, Jun 04 2021