OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
MATHEMATICA
f[n_] := n - n/FactorInteger[n][[1, 1]]; (* f is A060681 *)
g[n_] := g[n] = If[n == 1+f[n], n, g[1+f[n]]]; (* g is A323075 *)
b[_] = 0;
a[n_] := a[n] = With[{t = g[n]}, b[t] = b[t]+1];
Array[a, 105] (* Jean-François Alcover, Dec 20 2021 *)
PROG
(PARI)
up_to = 65537;
ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om, invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om, invec[i], (1+pt))); outvec; };
A060681(n) = (n-if(1==n, n, n/vecmin(factor(n)[, 1])));
v323165 = ordinal_transform(vector(up_to, n, A323075(n)));
A323165(n) = v323165[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 08 2019
STATUS
approved