OFFSET
1,2
COMMENTS
From Robert Israel, Sep 14 2017: (Start)
If m and n are coprime then a(m*n) = max(a(m),a(n)).
a(n) <= 2n.
Suppose p is a prime >= 5. Then
a(p) = 2p-1 if p is in A005382, otherwise 2p.
a(p^2) = 2p if p is in A005382, otherwise 3p.
(End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 3 because 4 divides psi(3!) = 12 and 3 is the least number with this property.
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 = 3 then
t:= 1; if e =1 then return 2 fi
else t:= 0:
fi;
for k from 2*p by p do
if isprime(k-1) then
t:= t+padic:-ordp(k, p);
if t >= e then return(k-1) fi;
fi;
t:= t + padic:-ordp(k, p);
if t >= e then return k fi;
od
else
max(seq(procname(t[1]^t[2]), t=F))
fi
end proc:
A(1):= 1:
map(A, [$1..100]); # Robert Israel, Sep 14 2017
MATHEMATICA
psi[n_] := Module[{p, e}, Product[{p, e} = pe; p^e + p^(e-1), {pe, FactorInteger[n]}]];
a[n_] := Module[{k = 1}, While[!Divisible[psi[k!], n], k++]; k]; a[2] = 3;
Array[a, 100] (* Jean-François Alcover, Oct 15 2020, after PARI *)
PROG
(PARI) a001615(n) = my(f=factor(n)); prod(i=1, #f~, f[i, 1]^f[i, 2] + f[i, 1]^(f[i, 2]-1));
a(n) = {my(k=1); while(a001615(k!) % n, k++); k; } \\ after Charles R Greathouse IV at A001615
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Altug Alkan, Sep 07 2017
STATUS
approved