login
Primes seen in the decimal expansion of Pi (disregarding the decimal point) that are contiguous, smallest and distinct.
17

%I #60 Jan 15 2023 19:49:52

%S 3,14159,2,653,5,89,7,9323

%N Primes seen in the decimal expansion of Pi (disregarding the decimal point) that are contiguous, smallest and distinct.

%C Sequence A121267 gives the number of digits of a(n) [but see also A229181 for a variant, cf. below]. The terms a(9)-a(11) had been found by Chris Nash in October 1999, and primality of the 3057-digit term a(9) has been proved in September 2002 by J. K. Andersen, who also found the next 5 terms a(12)-a(16) and the bound a(17) > 10^32000, cf. Rivera's web page "Problem 18". - _M. F. Hasler_, Aug 31 2013

%C There is a natural variant of the present sequence, using the same definition except for not requiring that all primes have to be distinct. That variant would have the same 3057-digit prime as next term a(9), and therefore have the same displayed terms and not justify a separate entry in the OEIS. However, terms beyond a(9) would be different: instead of a(10) = 73, a(11) = 467 and the 14650-digit PRP a(11), it would be followed by a'(10) = 7, a'(11) = 3 (which cuts a(10) = 73 in two pieces), a'(12) = 467, a'(13) = a'(14) = 2, and a'(15) equal to a 748-digit prime, see the a-file from J.-F. Alcover. Sequence A229181 lists the size of these terms. - _M. F. Hasler_, Sep 15 2013, updated Jan 18 2019

%H Jean-Francois Alcover, <a href="/A047777/a047777.txt">Table of n, v(n) for n = 1..100</a> for the variant with duplicates described in the comment. Initially submitted on Oct 16 2013 as b-file, uploaded as a-file by _Georg Fischer_, Jan 18 2019

%H Joseph L. Pe, <a href="http://web.archive.org/web/20090902201007/http://geocities.com/windmill96/primegen/eprimes.html">Trying to Write e as a Concatenation of Primes</a> (2009) [from Internet Archive Wayback Machine]

%H Carlos Rivera, <a href="http://www.primepuzzles.net/problems/prob_018.htm">Problem 18. Pi as a concatenation of the smallest contiguous different primes</a>, The Prime Puzzles and Problems Connection.

%H <a href="/index/Con#constant_primes">Index entries related to "constant primes".</a>

%e The first digit of Pi = 3.14159... is the prime 3, therefore a(1) = 3.

%e We discard this digit 3, and look for the first time a chunk of subsequent digits (always starting with the 1 coming right after the previously used 3) would be prime: 1, 14, 141, 1415 are not, but 14159 is. (The single-digit prime '5' was not considered, because we require the primes made from the whole contiguous chunk of digits starting after the previously found prime.) Thus, a(2) = 14159.

%e Thereafter, we have the single-digit prime a(3) = 2, and then a(4) = 653 (since neither 6 nor 65 is prime). - _M. F. Hasler_, Jan 18 2019

%t digits = Join[{{3}}, RealDigits[Pi, 10, 4000] // First // Rest]; used = {}; primes = digits //. {a:({_Integer..}..), b__Integer /; PrimeQ[p = FromDigits[{b}]] && FreeQ[used, p], c___Integer} :> (Print[p]; AppendTo[used, p]; {a, {p}, c}); Select[primes, Head[#] == List &] // Flatten (* _Jean-François Alcover_, Oct 16 2013 *)

%o (PARI) {default(realprecision,N=3500); x=Pi; S=a=[]; while(N > L=logint(p=floor(x),10), L%200||!L||print1("/*"L"*/"); if( ispseudoprime(p) && !setsearch(S,p), S=Set(a=concat(a,p)); print1(p","); x-=p; N-=logint(p,10)); x*=10); default(realprecision,38); a} \\ Remove the condition "&& !setsearch(S,p)" to get the variant allowing repetitions. The instruction "L%200..." is a progress indicator; it can be safely removed. - _M. F. Hasler_, Jan 18 2019

%Y Cf. A053013, A000796.

%Y Cf. A005042, A104841, A198018, A198019, A198187.

%K nice,nonn,base

%O 1,1

%A _Carlos Rivera_

%E The next term is the 3057-digit prime formed from digits 19 through 3075. It is 846264338327950...708303906979207. - _Mark R. Diamond_, Feb 22 2000

%E The two terms after that are 73 and 467. - _Jason Earls_, Apr 05 2001