OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MAPLE
MATHEMATICA
t[n_, k_]:= t[n, k]= If[k==1, 2^(n-1), If[k<n+1, (n-k+1)*Floor[(t[n, k -1] -1)/(n-k+1)], 0]]; (* t = A100461 *)
Table[2^(n-1) -t[n, n], {n, 60}] (* 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;
[2^(n-1) - t(n, n): n in [1..60]]; // 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))
[2^(n-1) - t(n, n) for n in range(1, 61)] # G. C. Greubel, Apr 07 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 23 2004
EXTENSIONS
More terms from R. J. Mathar, Aug 06 2007
STATUS
approved