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.

This page as a plain text file.
%I A307263 #42 Jul 08 2019 04:00:17
%S A307263 2,5,13,43,61,14897,377942237,75697732547
%N A307263 Primes p with a record number of iterations of the map p -> p - pi(p) until a nonprime is being reached.
%C A307263 a(9) > 1.7*10^11. - _Giovanni Resta_, Jul 07 2019
%e A307263 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.
%t A307263 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 *)
%o A307263 (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,", ")))
%Y A307263 Cf. A000720, A014689.
%K A307263 nonn,more
%O A307263 1,1
%A A307263 _Paolo Galliani_, Apr 01 2019
%E A307263 a(8) from _Giovanni Resta_, Jul 07 2019