Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #14 Jul 17 2023 18:23:57
%S 1,1,2,6,24,2399,6299,28222,169338,1244136,213748501,914608501,
%T 6392593442,57693964614,618160168824,150820728557099,895583729570699,
%U 8513087005239262,102642351647368962,1446049101566437896,457348626455818450501,3475580442134239108501
%N a(n) = (n^5 - n^4 - n^3 + n^2 - 1)*a(n-5) for n > 4, otherwise n!.
%H G. C. Greubel, <a href="/A123150/b123150.txt">Table of n, a(n) for n = 0..445</a>
%F a(n) = n! for n < 5, otherwise a(n) = (n^5 -n^4 -n^3 +n^2 -1)*a(n-5).
%t a[n_]:= a[n]= If[n<5, n!, (n^2*(n-1)*(n^2-1) -1)*a[n-5]];
%t Table[a[n], {n,0,30}]
%o (Magma)
%o function a(n) // a = A123150
%o if n le 4 then return Factorial(n);
%o else return (n^2*(n-1)*(n^2-1) -1)*a(n-5);
%o end if;
%o end function;
%o [a(n): n in [0..30]]; // _G. C. Greubel_, Jul 17 2023
%o (SageMath)
%o @CachedFunction # a = A123150
%o def a(n): return factorial(n) if (n<5) else (n^2*(n-1)*(n^2-1) -1)*a(n-5)
%o [a(n) for n in (0..30)] # _G. C. Greubel_, Jul 17 2023
%Y Cf. A123151.
%K nonn,easy
%O 0,3
%A _Roger L. Bagula_, Oct 01 2006
%E Edited by _N. J. A. Sloane_, Oct 04 2006
%E Edited by _G. C. Greubel_, Jul 17 2023