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

A198018 Yet unseen primes occurring within the first 1,2,3,4,... digits of Pi, A000796 (ordered according to position of last, then initial digit).

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Oct 20 2011

Keywords

Comments

Consider the first, then the first two, then the first three, ..., terms of A000796, i.e., decimal digits of Pi. Look whether the concatenation of a certain number of subsequent digits yields a prime which did not yet occur earlier (and thus necessarily involves the last of the considered digits). If so, add this prime to the sequence.
Contains A005042 as a subsequence.

Examples

			The first digit of the sequence is the prime a(1)=3.
The first two digits, "3.1", yield the prime a(2)=31.
In "3.14" there are no more primes. In "3.141" there is the prime a(3)=41.
In "3.1415" there is the prime a(4)=5.
In "3.14159" we have the primes 314159, 14159, 4159 and 59.
		

Crossrefs

Cf. A198019 ("new" primes ordered w.r.t. their size instead of starting position).

Programs

  • PARI
    {my(PI=digits(Pi\.1^30), seen=[]); for(i=1, #PI-1, for(j=1, i, my(p=fromdigits(PI[j..i])); !isprime(p) || setsearch(seen, p) || print1(p", ") || seen=setunion(seen,[p])))} \\ edited to use current PARI syntax by Andrew Howroyd and M. F. Hasler, May 10 2021
    
  • PARI
    {my(a=List()); for(m=0, precision(.)-3, my(pi=Pi\.1^m, p); for(k=0, m, !isprime(p=pi%10^(m-k+1)) && setsearch(Set(a), p) && listput(a,p))); a} \\ M. F. Hasler, May 10 2021

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", "))))

A226943 Semiprimes in the order in which they appear in the decimal expansion of Pi.

Original entry on oeis.org

4, 14, 314, 141, 15, 415, 1415, 9, 159, 6, 26, 926, 5926, 15926, 65, 265, 2653, 92653, 592653, 35, 535, 6535, 5926535, 58, 358, 265358, 314159265358, 589, 3589, 53589, 2653589, 92653589, 1592653589, 1415926535897, 979, 5358979, 59265358979, 159265358979
Offset: 1

Views

Author

Jonathan Vos Post, Sep 01 2013

Keywords

Comments

This is to semiprimes A001358 as A198019 is to primes A000040. Considering the first 1, 2, 3, 4, ... digits of the decimal expansion 3.14159... of Pi, record the semiprimes that have not occurred earlier, the smaller first if two or more appear by the n-th digit that have not been seen in the first n-1 digits.

Examples

			There are no semiprimes in the first 1 or 2 digits (3, 31). Then after 3 digits we have three: 4, 14, and 314 appearing for the first time. So a(1) = 4, a(2) = 14 and a(3) = 314.
		

Crossrefs

Programs

  • Mathematica
    semiQ[n_] := Total[Last /@ FactorInteger@n ] == 2; sp = Select[Range@ 999, semiQ]; spQ[n_] := If[n < 10^6, semiQ@n, ! Or @@ IntegerQ /@ (n/sp) && semiQ@ n]; seq = {}; Do[seq = Join[seq, Select[Union@ Complement[ Mod[FromDigits@ RealDigits[Pi, 10, n][[1]], 10^Range[n, 1, -1]], seq], spQ]], {n, 30}]; seq (* Giovanni Resta, Oct 01 2013 *)

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.