OFFSET
1,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
t[n_, k_]:= t[n, k]= If[k==1, 2^(n-1), (n-k+1)*Floor[(t[n, k-1] -1)/(n - k+1)]]; (* t = A100461 *)
Table[t[n, n], {n, 40}] (* G. C. Greubel, Apr 07 2023 *)
PROG
(Magma)
function t(n, k) // t = A100461
if k eq 1 then return 2^(n-1);
else return (n-k+1)*Floor((t(n, k-1) -1)/(n-k+1));
end if;
end function;
[t(n, n): n in [1..40]]; // G. C. Greubel, Apr 07 2023
(SageMath)
def t(n, k): # t = A100461
if (k==1): return 2^(n-1)
else: return (n-k+1)*((t(n, k-1) -1)//(n-k+1))
[t(n, n) for n in range(1, 41)] # G. C. Greubel, Apr 07 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 22 2004
STATUS
approved