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.

A104842 Position of the first sequence of n subsequent digits of Pi which form a prime.

Original entry on oeis.org

1, 1, 8, 3, 2, 1, 4, 34, 30, 5, 15, 2, 6, 17, 36, 82, 12, 87, 26, 12, 25, 133, 35, 18, 17, 3, 41, 17, 234, 17, 167, 92, 251, 15, 9, 12, 31, 1, 57, 290, 4, 99, 98, 502, 48, 164, 198, 201, 128, 7, 363, 143, 11, 138, 196, 32, 230, 82, 292, 515, 334, 186, 176, 223, 57, 135, 35
Offset: 1

Views

Author

Zak Seidov, Mar 27 2005

Keywords

Comments

Note that values with indices n = 22, 43, 55, ... are positions of primes with leading zeros, which is in particular manifest from a(42)=99, a(43)=98. See A198344 for the position of the "true" n-digit primes listed in A104841. - M. F. Hasler, Oct 23 2011

Examples

			a(1)=1 since the first single-digit prime found, 3, is at first place, hence a(1)=1,
a(2)=1 since the first two-digit prime found, 31, is at first place, hence a(2)=1,
a(3)=8 since the first three-digit prime found, 653, is at 8th place, hence a(3)=8, ...
		

Crossrefs

Programs

  • Mathematica
    pi = RealDigits[Pi, 10, 100][[1]]; f[n_] := Block[{k = 1}, While[ !PrimeQ[ FromDigits[ Take[pi, {k, k + n - 1}]]], k++ ]; k]; Table[ f[n], {n, 67}] (* Robert G. Wilson v, Mar 29 2005 *)
  • PARI
    a(n)={for(c=-1,default(realprecision)-n-2,ispseudoprime(Pi\.1^(n+c)%10^n)&return(c+2));error("Insufficient realprecision, please increase.")}  \\  M. F. Hasler, Oct 23 2011

Extensions

More terms from a(33) onward from Robert G. Wilson v, Mar 29 2005

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

A198344 Position of the first n-digit prime occurring in the decimal expansion of Pi, A000796.

Original entry on oeis.org

1, 1, 8, 3, 2, 1, 4, 34, 30, 5, 15, 2, 6, 17, 36, 82, 12, 87, 26, 12, 25, 215, 35, 18, 17, 3, 41, 17, 234, 17, 167, 92, 251, 15, 9, 12, 31, 1, 57, 290, 4, 99, 218, 502, 48, 164, 198, 201, 128, 7, 363, 143, 11, 138, 487, 32, 230, 82, 355, 515, 334, 186, 176, 223
Offset: 1

Views

Author

M. F. Hasler, Oct 23 2011

Keywords

Comments

Differs from A104842 in a(22), a(43), a(55),..., because here, leading zeros are not allowed.
The corresponding primes are listed in A104841.
Among the first 99 terms, even though values up to 825 occur, the values 1 and 17 occur 4 times, 12 and 57 occur 3 times, and numbers as large as 82, 164, 167 and 234 occur twice.

Examples

			a(1)=1 because the initial digit "3" of Pi is prime.
a(2)=a(6)=a(38)=1 because the first 2, 6, and 38 digits of Pi (including the initial 3) also form the primes 31, 314159 and 31415926535897932384626433832795028841, cf. A005042 and A060421.
		

Crossrefs

Programs

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

A186207 The first n-digit prime in the decimal expansion of 1/Pi.

Original entry on oeis.org

3, 31, 379, 8861, 86183, 886183, 8861837, 98861837, 929148091, 3098861837, 83098861837, 183098861837, 8618379067153, 28724068919291, 830988618379067, 7906715377675267, 12897495334688117, 675267450287240689, 7675267450287240689, 83098861837906715377
Offset: 1

Views

Author

Michel Lagneau, Feb 15 2011

Keywords

Comments

1/Pi = 0.31830988618379067153....

Crossrefs

Programs

  • Maple
    Digits := 10000: p0 := evalf(1/Pi)*10:for d from 1 to 20 do: id:=0:for i from
      0 to 50000 while(id=0) do :q0:=trunc(p0*10^(i+d-1)): x:= irem(q0,10^d): if type(x,prime)=true  and length(x)=d then printf(`%d, `,x):id:=1: else fi:od:od:
Showing 1-6 of 6 results.