OFFSET
0,3
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
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 *)
PROG
(Python)
prpr = 0
prev = f = 1
for n in range(2, 33):
print(prpr, end=', ')
f *= n
curr = f - prpr
prpr = prev
prev = curr
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Aug 03 2012
STATUS
approved