login
A123150
a(n) = (n^5 - n^4 - n^3 + n^2 - 1)*a(n-5) for n > 4, otherwise n!.
2
1, 1, 2, 6, 24, 2399, 6299, 28222, 169338, 1244136, 213748501, 914608501, 6392593442, 57693964614, 618160168824, 150820728557099, 895583729570699, 8513087005239262, 102642351647368962, 1446049101566437896, 457348626455818450501, 3475580442134239108501
OFFSET
0,3
LINKS
FORMULA
a(n) = n! for n < 5, otherwise a(n) = (n^5 -n^4 -n^3 +n^2 -1)*a(n-5).
MATHEMATICA
a[n_]:= a[n]= If[n<5, n!, (n^2*(n-1)*(n^2-1) -1)*a[n-5]];
Table[a[n], {n, 0, 30}]
PROG
(Magma)
function a(n) // a = A123150
if n le 4 then return Factorial(n);
else return (n^2*(n-1)*(n^2-1) -1)*a(n-5);
end if;
end function;
[a(n): n in [0..30]]; // G. C. Greubel, Jul 17 2023
(SageMath)
@CachedFunction # a = A123150
def a(n): return factorial(n) if (n<5) else (n^2*(n-1)*(n^2-1) -1)*a(n-5)
[a(n) for n in (0..30)] # G. C. Greubel, Jul 17 2023
CROSSREFS
Cf. A123151.
Sequence in context: A227886 A290961 A089718 * A086591 A173609 A294945
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