login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A344262
a(0)=1; for n>0, a(n) = a(n-1)*n+1 if n is even, (a(n-1)+1)*n otherwise.
5
1, 2, 5, 18, 73, 370, 2221, 15554, 124433, 1119906, 11199061, 123189682, 1478276185, 19217590418, 269046265853, 4035693987810, 64571103804961, 1097708764684354, 19758757764318373, 375416397522049106, 7508327950440982121, 157674886959260624562
OFFSET
0,2
FORMULA
E.g.f.: (x+1)*cosh(x)/(1-x). - Alois P. Heinz, May 14 2021
Lim_{n->infinity} a(n)/n! = 2*cosh(1) = A137204 = 2*A073743. - Amrit Awasthi, May 15 2021
a(n) = A344317(n) - A155521(n-1) for n > 0. - Alois P. Heinz, May 18 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