The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215096 a(0)=0, a(1)=1, a(n) = n! - a(n-2). 3
0, 1, 2, 5, 22, 115, 698, 4925, 39622, 357955, 3589178, 39558845, 475412422, 6187461955, 86702878778, 1301486906045, 20836087009222, 354385941189955, 6381537618718778, 121290714467642045, 2426520470557921222, 50969651457241797955, 1121574207307049758778 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
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,
f *= n
curr = f - prpr
prpr = prev
prev = curr
CROSSREFS
Cf. A000142.
Cf. A005165: a(0) = 0, a(n) = n! - a(n-1).
Sequence in context: A177251 A041807 A228711 * A115602 A115601 A015557
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Aug 03 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 25 03:08 EDT 2024. Contains 372782 sequences. (Running on oeis4.)