OFFSET
1,25
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..65536
EXAMPLE
a(25) = 2: 1 + 2 * (1 + 11) = 1 + 3 * (1 + 7) = 25.
a(43) = 3: 1 + 2 * (1 + 5 * (1 + 3)) = 1 + 3 * (1 + 13) = 1 + 7 * (1 + 5) = 43.
MAPLE
b:= proc(n, s) option remember; `if`(n=1, 1,
add(b((n-1)/p, s union {p}), p=numtheory[factorset](n-1) minus s))
end:
a:= n-> b(n, {}):
seq(a(n), n=1..200);
MATHEMATICA
b[n_, s_] := b[n, s] = If[n == 1, 1, Sum[If[p == 1, 0, b[(n - 1)/p, s ~Union~ {p}]], {p, FactorInteger[n - 1][[All, 1]] ~Complement~ s}]];
a[n_] := b[n, {}];
Array[a, 200] (* Jean-François Alcover, May 26 2019, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 24 2018
STATUS
approved