login
A139169
a(n)=smallest k >= 1 such that n divides prime(k)!.
3
1, 1, 2, 3, 3, 2, 4, 3, 4, 3, 5, 3, 6, 4, 3, 4, 7, 4, 8, 3, 4, 5, 9, 3, 5, 6, 5, 4, 10, 3, 11, 5, 5, 7, 4, 4, 12, 8, 6, 3, 13, 4, 14, 5, 4, 9, 15, 4, 7, 5, 7, 6, 16, 5, 5, 4, 8, 10, 17, 3, 18, 11, 4, 5, 6, 5, 19, 7, 9, 4, 20, 4, 21, 12, 5, 8, 5, 6, 22, 4, 5, 13, 23, 4, 7, 14, 10, 5, 24, 4, 6, 9, 11, 15
OFFSET
1,3
LINKS
MAPLE
f:= proc(n) local F, m, Q, E, p;
F:= ifactors(n)[2];
m:= nops(F);
Q:= map(t -> t[1], F);
E:= map(t -> t[2], F);
p:= max(Q)-1;
do
p:= nextprime(p);
if andmap(i -> add(floor(p/Q[i]^j), j=1..floor(log[Q[i]](p))) >= E[i], [$1..m]) then return p fi;
od
end proc:
f(1):= 2:
map(numtheory:-pi @ f, [$1..100]); # Robert Israel, Mar 07 2018
MATHEMATICA
a = {}; Do[m = 1; While[ ! IntegerQ[Prime[m]!/n], m++ ]; AppendTo[a, m], {n, 1, 100}]; a
PROG
(PARI) a(n) = forprime(p=2, , if (!(p! % n), return (primepi(p)))); \\ Michel Marcus, Mar 08 2018
KEYWORD
nonn
AUTHOR
Artur Jasinski, Apr 11 2008
STATUS
approved