OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
FORMULA
MAPLE
with(numtheory):
d:= n-> n*add(i[2]*pi(i[1])/i[1], i=ifactors(n)[2]):
a:= proc() local t, a; t, a:= -1, proc() -1 end;
proc(n) local h;
while a(n) = -1 do
t:= t+1; h:= d(d(t));
if a(h) = -1 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=0..100);
MATHEMATICA
d[n_] := d[n] = If[n == 0, 0, n*Total[Last[#]*PrimePi[First[#]]/First[#]& /@ FactorInteger[n]]];
A[n_, k_] := For[m = 0, True, m++, If[Nest[d, m, k] == n, Return[m]]];
a[n_] := A[n, 2];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 17 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 12 2015
STATUS
approved