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.

Showing 1-6 of 6 results.

A005042 Primes formed by the initial digits of the decimal expansion of Pi.

Original entry on oeis.org

3, 31, 314159, 31415926535897932384626433832795028841
Offset: 1

Views

Author

Keywords

Comments

The next term consists of the first 16208 digits of Pi and is too large to show here (see A060421). Ed T. Prothro found this probable prime in 2001.
A naive probabilistic argument suggests that the sequence is infinite. - Michael Kleber, Jun 23 2004

References

  • M. Gardner, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A060421 for further terms.

Programs

  • Maple
    Digits := 130; n0 := evalf(Pi); for i from 1 to 120 do t1 := trunc(10^i*n0); if isprime(t1) then print(t1); fi; od:
  • Mathematica
    a = {}; Do[k = Floor[Pi 10^n]; If[PrimeQ[k], AppendTo[a, k]], {n, 0, 160}]; a (* Artur Jasinski, Mar 26 2008 *)
    nn=1000;With[{pidigs=RealDigits[Pi,10,nn][[1]]},Select[Table[FromDigits[ Take[pidigs,n]],{n,nn}],PrimeQ]] (* Harvey P. Dale, Sep 26 2012 *)
  • PARI
    c=Pi;for(k=0,precision(c),isprime(c\.1^k) & print1(c\.1^k,",")) \\ - M. F. Hasler, Sep 01 2013

Formula

a(n) = floor(10^(A060421(n)-1)*A000796), where A000796 is the constant Pi = 3.14159... . - M. F. Hasler, Sep 02 2013

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

Original entry on oeis.org

3, 14159, 2, 653, 5, 89, 7, 9323
Offset: 1

Views

Author

Keywords

Comments

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
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

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
		

Crossrefs

Programs

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

A198019 Primes occurring in the decimal expansion of Pi (A000796), ordered by position of last digit, then by size.

Original entry on oeis.org

3, 31, 41, 5, 59, 4159, 14159, 314159, 2, 53, 653, 1592653, 89, 141592653589, 7, 97, 5897, 35897, 6535897, 5926535897, 415926535897, 79, 58979, 358979, 589793, 23, 9323, 9265358979323, 43, 643, 462643, 93238462643, 433, 83, 383, 2643383, 38462643383, 89793238462643383, 41592653589793238462643383
Offset: 1

Views

Author

M. F. Hasler, Oct 20 2011

Keywords

Comments

Cf. A198018; the only difference is that here we list the "new primes" by increasing size (for a given subsequence of A000796).
Considering the first 1, 2, 3, 4,.... digits of the decimal expansion 3.14159... of Pi, record the primes that have not occurred earlier.
Sequence A198187 lists "duplicate" primes multiple times, each time they occur anew ending in another decimal place. - M. F. Hasler, Sep 01 2013

Examples

			In Pi = 3... we have the prime a(1)=3.
In Pi = 3.1.... we have the prime a(2)=31.
In Pi = 3.14... we have no new prime.
In Pi = 3.141.... we have the prime a(3)=41.
In Pi = 3.1415.... we have the new prime a(5)=5.
In Pi = 3.14159.... we have the new primes (listed in increasing order) a(6)=59, a(7)=4159, a(8)=14159 and a(9)=314159. [_M. F. Hasler_, Sep 01 2013]
		

Crossrefs

Programs

  • PARI
    {t=Pi; u=[]; for(i=0,precision(t), for(k=1,i+1, ispseudoprime(p=t\.1^i%10^k)& !setsearch(u,p)& (u=setunion(u,Set(p)))&print1(p",")))}

A072952 Primes obtained as initial segments of the decimal expansion of the Euler-Mascheroni constant gamma = 0.5772... .

Original entry on oeis.org

5, 577, 5772156649015328606065120900824024310421
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 12 2002

Keywords

Comments

The next term (a(4)) has 185 digits and is too large to include. - Harvey P. Dale, May 14 2013
Sequence A065815 gives the number of digits of a(n), resp. numbers k such that a(n) = floor(gamma*10^k). Sequences A005042, A007512, A115453, A119343, A210704, ... are the analog of the present sequence for Pi, e, sqrt(2), sqrt(3), 3^(1/3), ... - M. F. Hasler, Aug 31 2013
The original wording of the definition (and example) was "primes found in the decimal expansion..." which could as well refer to the sequence (5,7,7,215664901,5,3,2, ...) or (5,7,72156649, ...) or (5,7,7215664901, ...) (analogs to A047777 or A195834), or to the sequence (5,7,57, ...), analog to A198018. - M. F. Hasler, Sep 01 2013

Examples

			a(2) = 577, since 577 is the second prime obtained as initial segment of the decimal expansion of Euler-Mascheroni constant gamma = 0.577215664... .
		

Crossrefs

Analogous sequences: A005042 (Pi), A007512 (e), A115453 (sqrt(2)), A119343 (sqrt(3)), A210704 (3^(1/3)).

Programs

  • Mathematica
    nn=200;With[{emc=RealDigits[EulerGamma,10,nn][[1]]},Select[Table[ FromDigits[ Take[emc,n]],{n,nn}],PrimeQ]] (* Harvey P. Dale, May 14 2013 *)
  • PARI
    default(realprecision, 777); /* use that many digits */
    A072952={(c=Euler, v=1/*set to 0 for indices (i.e., A065815) instead of values*/)->for(k=0, precision(c), ispseudoprime(p=c\.1^k)&&print1([k, p][1+v]", "))} \\ M. F. Hasler, Aug 31 2013

A198187 Primes from the decimal expansion of Pi, sorted first by the final digit index and then by length.

Original entry on oeis.org

3, 31, 41, 5, 59, 4159, 14159, 314159, 2, 5, 3, 53, 653, 1592653, 5, 89, 141592653589, 7, 97, 5897, 35897, 6535897, 5926535897, 415926535897, 79, 58979, 358979, 3, 589793, 2, 3, 23, 9323, 9265358979323, 2, 3, 43, 643, 462643, 93238462643, 3, 433, 3, 83, 383
Offset: 1

Views

Author

Keywords

Comments

In this sequence, primes are listed each time they occur (again) with a new ending position, in contrast to A198019 where only the first occurrence of each prime is listed. - M. F. Hasler, Sep 02 2013

Examples

			The first digit is 3, which is prime, so a(1) = 3.
The second digit is 1, which is no prime, but 31 is prime, so a(2) = 31.
The third digit is 4, which does not end any prime.
The fourth digit is 1, not prime, but 41 is prime, so a(3) = 41.
		

Crossrefs

Programs

  • PARI
    v=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 6, 4, 3, 3, 8, 3]
    for(n=1,#v,x=0;p=1;forstep(k=n,1,-1,x+=p*v[k];p*=10;if(v[k]&&isprime(x),print1(x", "))))

A245571 a(n) is the smallest prime number with at least two digits formed by the concatenation of the subsequent digits of Pi, starting at the n-th digit, ignoring the decimal point.

Original entry on oeis.org

31, 14159, 41, 1592653, 59, 9265358979323, 26535897932384626433832795028841971693993751058209, 653, 53, 35897, 5897, 89, 97, 79, 9323, 32384626433832795028841971693993751058209749445923078164062862089986280348253421, 23, 38462643383
Offset: 1

Views

Author

Felix Fröhlich, Aug 22 2014

Keywords

Comments

a(19) has 3057 digits. - Robert Israel, Aug 27 2014
a(20) = 462643. - Felix Fröhlich, Aug 30 2014
a(21) has >= 3490 digits, a(22) = 2643383, a(22)-a(42) have 20 or fewer digits. - Chai Wah Wu, Sep 24 2014

Examples

			a(4) = 1592653, because starting at the 4th digit in the expansion, the smallest substring of the digits of Pi forming a prime number is 3.14|1592653|589...
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to use up to N+1 digits of pi.
    nmax:= 30: # to get up to a(nmax), if possible.
    S:= floor(10^N*Pi):
    L:= ListTools:-Reverse(convert(S,base,10)):
    for n from 1 to nmax do
      p:= L[n];
      for k1 from n+1 to N+1 do
        p:= 10*p + L[k1];
        if isprime(p) then break fi
      od:
      if k1 > N+1 then
        A[n]:= "Ran out of digits";
        break
       else
        A[n]:= p
      end
    od:
    seq(A[i],i=1..n-1); # Robert Israel, Aug 27 2014
  • Python
    from sympy.mpmath import *
    from sympy import isprime
    def A245571(n):
        mp.dps = 1000+n
        s = nstr(pi,mp.dps)[:-1].replace('.','')[n-1:]
        for i in range(len(s)-1):
            p = int(s[:i+2])
            if p > 10 and isprime(p):
                return p
        else:
            return 'Ran out of digits'
    # Chai Wah Wu, Sep 16 2014, corrected Chai Wah Wu, Sep 24 2014
Showing 1-6 of 6 results.