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.

A307263 Primes p with a record number of iterations of the map p -> p - pi(p) until a nonprime is being reached.

Original entry on oeis.org

2, 5, 13, 43, 61, 14897, 377942237, 75697732547
Offset: 1

Views

Author

Paolo Galliani, Apr 01 2019

Keywords

Comments

a(9) > 1.7*10^11. - Giovanni Resta, Jul 07 2019

Examples

			5 is in the sequence because if you start the algorithm from every prime < 5, you obtain a number of primes less than starting from 5. In fact, starting from 5, which is the 3rd prime number, you have (5-pi(5))=2, which is prime, then (2-pi(2))=1, which is not prime and so the algorithm stops. So applying the algorithm from 5 you have two prime numbers, 5 and 2. If you start the algorithm from any other prime < 5, then you have only one prime.
		

Crossrefs

Programs

  • Mathematica
    f[p_] := Module[{c = 0, q = p}, While[PrimeQ[q], q -= PrimePi[q]; c++]; c]; fm = 0; s = {}; Do[f1 = f[n]; If[f1 > fm, fm = f1; AppendTo[s, n]], {n, 1, 15000}]; s (* Amiram Eldar, Jul 06 2019 *)
  • PARI
    maxi=0; forprime(q=1, 10^8, p=q; r=0; while(isprime(p)==1, r=r+1; s=primepi(p); p=p-s); if(r>maxi, maxi=r; print1(q,", ")))

Extensions

a(8) from Giovanni Resta, Jul 07 2019