OFFSET
0,2
FORMULA
E.g.f.: (x+1)*cosh(x)/(1-x). - Alois P. Heinz, May 14 2021
EXAMPLE
a(0) = 1;
a(1) = (a(0)+1)*1 = (1+1)*1 = 2;
a(2) = (a(1)*2)+1 = (2*2)+1 = 5;
a(3) = (a(2)+1)*3 = (5+1)*3 = 18;
a(4) = (a(3)*4)+1 = (18*4)+1 = 73;
a(5) = (a(4)+1)*5 = (73+1)*5 = 370.
MAPLE
a:= proc(n) a(n):= n*a(n-1) + n^(n mod 2) end: a(0):= 1:
seq(a(n), n=0..22); # Alois P. Heinz, May 14 2021
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[OddQ[n], (n - 1)*a[n - 1] + 1, (n - 1)*(a[n - 1] + 1)]; Array[a, 25] (* Amiram Eldar, May 13 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amrit Awasthi, May 13 2021
STATUS
approved