Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #12 Mar 08 2018 02:42:40
%S 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,
%T 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,
%U 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
%N a(n)=smallest k >= 1 such that n divides prime(k)!.
%H Robert Israel, <a href="/A139169/b139169.txt">Table of n, a(n) for n = 1..10000</a>
%p f:= proc(n) local F,m,Q,E,p;
%p F:= ifactors(n)[2];
%p m:= nops(F);
%p Q:= map(t -> t[1],F);
%p E:= map(t -> t[2],F);
%p p:= max(Q)-1;
%p do
%p p:= nextprime(p);
%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;
%p od
%p end proc:
%p f(1):= 2:
%p map(numtheory:-pi @ f, [$1..100]); # _Robert Israel_, Mar 07 2018
%t a = {}; Do[m = 1; While[ ! IntegerQ[Prime[m]!/n], m++ ]; AppendTo[a, m], {n, 1, 100}]; a
%o (PARI) a(n) = forprime(p=2,, if (!(p! % n), return (primepi(p)))); \\ _Michel Marcus_, Mar 08 2018
%Y Indices of primes in A139171.
%Y Cf. A082672, A089085, A089130, A117141, A007749, A139056-A139066, A139068, A137390, A139070-A139075, A139148-A139157, A139159, A139160-A139166, A139089, A139168-A139170.
%K nonn
%O 1,3
%A _Artur Jasinski_, Apr 11 2008