OFFSET
1,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
MAPLE
b:= proc() 0 end: g:= proc() 0 end:
h:= proc(n) option remember; local t;
t:= numtheory[phi](n); b(t):= b(t)+1
end:
a:= proc(n) option remember; local t;
t:= h(n); g(t):= g(t)+1
end:
seq(a(n), n=1..120); # Alois P. Heinz, Apr 30 2018
MATHEMATICA
b[_] = 0; g[_] = 0;
h[n_] := h[n] = With[{t = EulerPhi[n]}, b[t] = b[t]+1];
a[n_] := a[n] = With[{t = h[n]}, g[t] = g[t]+1];
Array[a, 120] (* Jean-François Alcover, Dec 19 2021, after Alois P. Heinz *)
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; };
v081373 = ordinal_transform(vector(up_to, n, eulerphi(n)));
A081373(n) = v081373[n];
v303777 = ordinal_transform(vector(up_to, n, A081373(n)));
A303777(n) = v303777[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 30 2018
STATUS
approved