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-4 of 4 results.

A076106 Out of all the n-digit primes, which one takes the longest time to appear in the digits of Pi (ignoring the initial 3)? The answer is a(n), and it appears at position A076130(n).

Original entry on oeis.org

7, 73, 373, 9337, 35569, 805289, 9271903
Offset: 1

Views

Author

Jean-Christophe Colin (jc-colin(AT)wanadoo.fr), Oct 31 2002

Keywords

Comments

a(8) requires > 1 billion digits of Pi. - Michael S. Branicky, Jul 08 2021

Examples

			Of all the 2-digit primes, 11 to 97, the last one to appear in Pi is 73, at position 299 (see A076130). - _N. J. A. Sloane_, Nov 28 2019
		

Crossrefs

Programs

  • Python
    # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
    with open('pi-billion.txt', 'r') as f: digits_of_pi = f.readline()[2:]
    # from sympy import S
    # digits_of_pi = str(S.Pi.n(72*10**4))[2:] # alternate to loading data
    from sympy import primerange
    def A076106_A076130(n):
        global digits_of_pi
        bigp, bigloc = None, -1
        for p in primerange(10**(n-1), 10**n):
            loc = digits_of_pi.find(str(p))
            if loc == -1: print("not enough digits", n, p)
            if loc > bigloc:
                bigloc = loc
                bigp = p
        return (bigp, bigloc+1)
    print([A076106_A076130(n)[0] for n in range(1, 6)]) # Michael S. Branicky, Jul 08 2021

Extensions

Definition clarified by N. J. A. Sloane, Nov 28 2019
a(7) from Michael S. Branicky, Jul 08 2021

A076129 Position of first n-digit prime encountered in decimal expansion of Pi (ignoring the initial 3).

Original entry on oeis.org

4, 2, 7, 2, 1, 9, 3, 33, 29, 4, 14, 1, 5, 16, 35, 81, 11, 86, 25, 11, 24, 214, 34, 17, 16, 2, 40, 16, 233, 16, 166, 91, 250, 14, 8, 11, 30, 2, 56, 289, 3, 98, 217, 501, 47, 163, 197, 200, 127, 6, 362, 142, 10, 137, 486, 31, 229, 81, 354, 514, 333, 185, 175, 222
Offset: 1

Views

Author

Jean-Christophe Colin (jc-colin(AT)wanadoo.fr), Oct 31 2002

Keywords

Crossrefs

A076130 Out of all the n-digit primes, which one takes the longest time to appear in the digits of Pi (ignoring the initial 3)? The answer is A076106(n) and the position where this prime appears is a(n).

Original entry on oeis.org

13, 299, 5229, 75961, 715492, 11137824, 135224164
Offset: 1

Views

Author

Jean-Christophe Colin (jc-colin(AT)wanadoo.fr), Oct 31 2002

Keywords

Comments

a(8) requires more than 10^9 digits of Pi. - Michael S. Branicky, Jul 08 2021

Examples

			Of all the 2-digit primes, 11 to 97, the last one to appear in Pi is 73, at position 299 (see A076106).  - _N. J. A. Sloane_, Nov 28 2019
		

Crossrefs

Programs

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010
Definition clarified by N. J. A. Sloane, Nov 28 2019
a(7) from Michael S. Branicky, Jul 08 2021

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-4 of 4 results.