cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A139169 a(n)=smallest k >= 1 such that n divides prime(k)!.

Original entry on oeis.org

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

Views

Author

Artur Jasinski, Apr 11 2008

Keywords

Crossrefs

Programs

  • 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
  • PARI
    a(n) = forprime(p=2,, if (!(p! % n), return (primepi(p)))); \\ Michel Marcus, Mar 08 2018