OFFSET
1,2
COMMENTS
LINKS
FORMULA
MAPLE
g:= proc(n, i) option remember; `if`(n=0 or i<2, [2^n], [seq(
map(p->p*ithprime(i)^j, g(n-i*j, i-1))[], j=0..n/i)]) end:
b:= proc() local l, i; l:=[]; i:=0;
proc(n) while nops(l)<n do
l:=[l[], sort(g(i, i))[]]; i:=i+1 od; l[n]
end
end():
a:= proc() local t, a; t, a:= 0, proc() -1 end;
proc(n) local h;
while a(n) = -1 do
t:= t+1; h:= b(t);
if a(h) = -1 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=1..100);
MATHEMATICA
g[n_, i_] := g[n, i] = If[n == 0 || i < 2, {2^n}, Flatten[ Table[ #*Prime[i]^j& /@ g[n - i*j, i - 1], {j, 0, n/i}]]];
b[n_] := Module[{l, i}, l = {}; i = 0; While[Length[l] < n, l = Join[l, Sort[g[i, i]]]; i++]; l[[n]]];
a[n_] := Module[{t, a}, t = 0; a[_] = -1; Module[{h}, While[a[n] == -1, t++; h = b[t]; If[a[h] == -1, a[h] = t]]]; a[n]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 14 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Aug 13 2012
STATUS
approved