OFFSET
0,3
LINKS
John Riordan and N. J. A. Sloane, Correspondence, 1974
FORMULA
D-finite with recurrence: (-n+2)*a(n) +(n-1)^2*a(n-1) +2*(-n+2)*a(n-2) +(-n^2+4*n-2)*a(n-3) +(n-1)*a(n-4)=0. - R. J. Mathar, Jul 15 2015
MAPLE
b:= proc(n) b(n):= `if`(n<2, 1, n*b(n-1)-b(n-2)+1+(-1)^n) end:
a:= n-> `if`(n=0, 0, b(n-1)+b(n)-1):
seq(a(n), n=0..22); # Alois P. Heinz, Jun 17 2021
MATHEMATICA
b[n_] := b[n] = If[n<2, 1, n*b[n-1] - b[n-2] + 1 + (-1)^n];
a[n_] := If[n == 0, 0, b[n-1] + b[n] - 1];
Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Dec 26 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 07 2015, based on a suggestion from John Riordan, Nov 14 1974.
EXTENSIONS
Offset corrected by N. J. A. Sloane, Jun 16 2021
STATUS
approved