OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
kT:= {}: kF:= {}:
f:= proc(t) uses numtheory; local S, R, i, val, s; global kT, kF;
if member(t, kT) then return true elif member(t, kF) then return false fi;
R[0]:= t;
S:= {t};
for i from 1 do
R[i]:= sigma(phi(R[i-1]));
if member(R[i], kT) then val:= true
elif member(R[i], kF) then val:= false
elif member(R[i], S) then
val:= evalb(R[i-3] = R[i]) and not member(R[i], [R[i-1], R[i-2]])
else val:= fail; S:= S union {R[i]}
fi;
if val = true then kT:= kT union {R[i]} union S; return true
elif val = false then kF:= kF union {R[i]} union S; return false
fi
od;
end proc:
select(f, [$1..3000]); # Robert Israel, Jun 09 2024
MATHEMATICA
f[n_] := DivisorSigma[1, EulerPhi[n]]; g[n_] := Block[{l = NestWhileList[f, n, UnsameQ, All]}, -Subtract @@ Flatten[ Position[l, l[[ -1]]]]]; Select[ Range[ 1396], g[ # ] == 3 &] (* Robert G. Wilson v, Jul 23 2004 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 19 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 23 2004
STATUS
approved