A047777 Primes seen in the decimal expansion of Pi (disregarding the decimal point) that are contiguous, smallest and distinct.
3, 14159, 2, 653, 5, 89, 7, 9323
Offset: 1
Examples
The first digit of Pi = 3.14159... is the prime 3, therefore a(1) = 3. 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. 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
Links
- Jean-Francois Alcover, Table of n, v(n) for n = 1..100 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
- Joseph L. Pe, Trying to Write e as a Concatenation of Primes (2009) [from Internet Archive Wayback Machine]
- Carlos Rivera, Problem 18. Pi as a concatenation of the smallest contiguous different primes, The Prime Puzzles and Problems Connection.
- Index entries related to "constant primes".
Programs
-
Mathematica
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 *)
-
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
Extensions
The next term is the 3057-digit prime formed from digits 19 through 3075. It is 846264338327950...708303906979207. - Mark R. Diamond, Feb 22 2000
The two terms after that are 73 and 467. - Jason Earls, Apr 05 2001
Comments