OFFSET
1,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
For all n >= 1, a(A000040(n)) = n.
MAPLE
b:= proc() 0 end:
a:= proc(n) option remember; local t;
t:= numtheory[phi](n)-n; b(t):= b(t)+1
end:
seq(a(n), n=1..120); # Alois P. Heinz, Apr 30 2018
MATHEMATICA
b[_] = 0;
a[n_] := a[n] = With[{t = EulerPhi[n]-n}, b[t] = b[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; };
A051953(n) = (n - eulerphi(n));
v303753 = ordinal_transform(vector(up_to, n, A051953(n)));
A303753(n) = v303753[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 30 2018
STATUS
approved