login
A123151
a(n) = A000124(n)*a(n-3) for n > 2, otherwise n!.
2
1, 1, 2, 7, 11, 32, 154, 319, 1184, 7084, 17864, 79328, 559636, 1643488, 8408768, 67715956, 225157856, 1294950272, 11647144432, 43005150496, 273234507392, 2702137508224, 10923308225984, 75685958547584, 813343389975424, 3560998481670784, 26641457408749568
OFFSET
0,3
LINKS
FORMULA
a(n) = n! for n < 3, otherwise a(n) = A000124(n)*a(n-3), where A000124(n) = (n^2 + n + 2)/2.
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
Sequence in context: A336342 A284354 A228076 * A371201 A026133 A026162
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