OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
From Robert Israel, Aug 15 2016: (Start)
If m and n are coprime then a(m*n) = max(a(m),a(n)).
a(n) <= 2n, with equality iff n is an odd prime.
Suppose p is an odd prime. Then
a(p) = 2p
If 2p+1 is prime then a(p^2) = 2p+1 and a(p^3) = 3p.
Otherwise a(p^2) = 3p and a(p^3) = 4p. (End)
EXAMPLE
a(4) = 4 because 4 divides phi(4!) = 8.
MAPLE
A:= proc(n) option remember;
local F, p, e, t, k;
F:= ifactors(n)[2];
if nops(F)=1 then
p:= F[1][1];
e:= F[1][2];
if p = 2 then
t:= 1; if e=1 then return 3 fi;
else
t:= 0
fi;
for k from 2*p by p do
t:= t + padic:-ordp(k, p);
if t >= e then return k fi;
if isprime(k+1) then
t:= t+padic:-ordp(k, p);
if t >= e then return(k+1) fi;
fi;
od
else
max(seq(procname(t[1]^t[2]), t=F))
fi
end proc:
A(1):= 1:
map(A, [$1..100]); # Robert Israel, Aug 15 2016
MATHEMATICA
With[{ep=Table[{EulerPhi[k!], k}, {k, 200}]}, Table[SelectFirst[ep, Divisible[#[[1]], n]&], {n, 80}]][[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 22 2018 *)
PROG
(PARI) a(n) = {my(k = 1); while(eulerphi(k!) % n, k++); k; }
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Altug Alkan, Aug 15 2016
STATUS
approved