OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..500
FORMULA
MATHEMATICA
a[n_]:= a[n]= If[n<3, n!, (1/2)*(n^2+n+2)*a[n-3]];
Table[a[n], {n, 0, 30}]
PROG
(Magma)
function a(n) // a = A123151
if n le 2 then return Factorial(n);
else return (n^2+n+2)*a(n-3)/2;
end if;
end function;
[a(n): n in [0..30]]; // G. C. Greubel, Jul 17 2023
(SageMath)
@CachedFunction # a = A123151
def a(n): return factorial(n) if (n<3) else (n^2+n+2)*a(n-3)/2
[a(n) for n in (0..30)] # G. C. Greubel, Jul 17 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Oct 01 2006
EXTENSIONS
Edited by N. J. A. Sloane, Oct 04 2006
Edited by G. C. Greubel, Jul 17 2023
STATUS
approved