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.

Previous Showing 21-29 of 29 results.

A276195 Smallest prime >= decimal expansion of Pi truncated to n places (A011545).

Original entry on oeis.org

3, 31, 317, 3163, 31469, 314159, 3141601, 31415971, 314159311, 3141592661, 31415926541, 314159265359, 3141592653601, 31415926535933, 314159265359057, 3141592653589861, 31415926535897999, 314159265358979347, 3141592653589793239, 31415926535897932429, 314159265358979323861
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 24 2016

Keywords

Examples

			a(6) = 3141601, since this is the smallest prime >= floor(Pi*10^6) = 3141592.
Pi = 3.1415926535897932384626433832795028841971…
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[Floor[Pi 10^n] - 1], {n, 0, 20}]
    Module[{nn=30,pid},pid=RealDigits[Pi,10,nn][[1]];Table[NextPrime[FromDigits[Take[pid,n]]-1],{n,nn}]] (* Harvey P. Dale, Mar 01 2024 *)

Formula

a(n) = A007918(A011545(n)).
a(n) = A000040(A000720(A011545(n)-1)+1).
a(A060421(n)-1) = A005042(n).

A276199 Smallest prime that begins with at least n digits of Pi.

Original entry on oeis.org

3, 31, 31469, 314107, 314159, 314159, 314159207, 3141592603, 31415926541, 314159265307, 314159265359, 3141592653581, 314159265358909, 3141592653589711, 31415926535897921, 314159265358979347, 3141592653589793239, 3141592653589793239, 314159265358979323861
Offset: 1

Views

Author

Keywords

Examples

			a(7) = 314159207, begins with first 7 digits of Pi = 3.141592653...
		

Crossrefs

Cf. A005042.

Programs

  • Perl
    use ntheory ":all"; sub a276199 { my $l=shift; my $p="3".substr(Pi($l+20),2,$l-1); for my $dig (0 .. 20) { my $add = "0" x $dig; do { return "$p$add" if is_prime("$p$add"); } while length(++$add) == $dig; } } # Dana Jacobsen, Aug 30 2016

A283247 a(n) is the smallest prime number whose representation contains as a substring the first n digits of Pi in base 10.

Original entry on oeis.org

3, 31, 13147, 73141, 314159, 314159, 131415923, 1314159269, 23141592653, 23141592653, 314159265359, 3141592653581, 213141592653589, 1131415926535897, 9314159265358979, 173141592653589793, 3141592653589793239, 3141592653589793239, 314159265358979323861
Offset: 1

Views

Author

Manan Shah, Jul 20 2017

Keywords

Comments

Pi progresses as 3, 31, 314, 3141, hence minimal prime numbers that do this are 3, 31, 13147, 73141. While there are other primes that contain, say, 314, the prime number, 13147 is the first prime to do so.
It is probably provable that this is an infinite sequence. Notice that 314159 appears twice in the sequence since 314159 is the smallest prime that contains 31415 as well as 314159.
a(n) exists for all n since for sufficiently large k, the k-th prime gap < prime(k)^d for some d < 1, so for a fixed number a, the next prime after a*10^m will be less than (a+1)*10^m for sufficiently large m and thus contain a as a substring. - Chai Wah Wu, Feb 22 2018

Examples

			a(4) = 73141 since 73141 is the smallest prime number that contains 3141 (the first 4 digits of Pi).
a(5) = 314159 since 314159 is the smallest prime number that contains 31415.
a(6) = 314159 since 314159 is the smallest prime number that contains 314159.
		

Crossrefs

Programs

  • Mathematica
    pp[n_] := If[PrimeQ@n, n, Block[{d = IntegerDigits@n, p, s, t}, p = 10^Length[d]; s = Select[Join[Range[9] p + n, {1,3,7,9} + 10 n], PrimeQ]; If[s != {}, Min@s, s = NextPrime[100 n]; t = Join[If[Floor[s/100] == n, {s}, {}], Range[10, 99] p + n, FromDigits /@ Flatten /@ Tuples[{Range@9, {d}, {1, 3, 7, 9}}]]; s = Select[t, PrimeQ]; If[s == {}, 0, Min@s]]]]; Table[pp[Floor[10^e Pi]], {e, 0, 18}] (* Giovanni Resta, Jul 21 2017 *)
  • Python
    pi_digits = pi_digit_generator #user-defined generator for producing next digit of Pi
    next_digit = pi_digits.next() #first call, so next_digit = 3
    primes = prime_generator #user-defined generator for producing next prime
    current_prime = primes.next() #first call, so current_prime = 2
    pi_progress = 0
    while True:
        pi_progress = pi_progress*10 + next_digit
        while str(pi_progress) not in str(current_prime):
            current_prime = primes.next()
        print(pi_progress,current_prime)

Extensions

a(7)-a(19) from Giovanni Resta, Jul 21 2017

A119424 Length of primes formed by the initial decimal digits of the base e expansion of Pi.

Original entry on oeis.org

3, 18, 84, 373, 1410
Offset: 1

Views

Author

Jonathan Vos Post, Jul 26 2006

Keywords

Examples

			a(1) = 3 because the first 3 digits of the base e expansion of Pi are 10.1 [meaning pi ~ 1*(e^1) + 0*(e^0) + 1*(e^-1)] and 101 (base 10) is prime.
a(2) = 18 because the first 18 digits of the base e expansion of Pi are 1, 0, 1010020200021111 which (base 10) is prime.
a(3) = 84 because there are 84 digits in 101010020200021111200201011200010102020001110120200101200020011011201012100100021001 which is prime.
		

Crossrefs

A174277 Primes formed by the initial digits of the decimal expansion of Pi^(1/Pi).

Original entry on oeis.org

1439, 143961949, 1439619495847590688336490804973755678698296474456640982233160641890243439489175847819775046598413042034429435933431518691836732951984722119433079301
Offset: 1

Views

Author

Keywords

Comments

John von Neumann et al. used ENIAC to compute 2037 digits of Pi in 1949, a calculation that took 70 hours. As of Jan 2010, the record is almost 2.7 trillion digits. The symbol for Pi was first put into use by mathematician William Jones in 1706, but only became famous after Swiss mathematician Leonard Euler used it in 1737.
As of March 2019, more than 31 trillion digits of Pi have been calculated. - Harvey P. Dale, Jul 21 2021

Crossrefs

Programs

  • Mathematica
    Select[a=Pi^(1/Pi);Table[Floor[a*10^n],{n,0,200}],PrimeQ[ # ]&]

A231336 Integers n such that appending some decimal digit to the first n digits of Pi results in a prime.

Original entry on oeis.org

0, 1, 2, 5, 11, 12, 18, 37, 39, 77, 82, 100, 125, 128, 220, 305, 601, 676, 1692, 1901, 2202, 2253, 2394, 3318, 3970, 5826, 7001, 9853, 12607, 13434, 16207
Offset: 1

Views

Author

Keywords

Comments

A140515 is a proper subsequence. A060421 - 1 is a proper subsequence. So the terms 47576 & 78072 are also members.

Examples

			0 is in the sequence since 2, 3, 5, and 7 are all primes;
1 is in the sequence since 31 and 37 are both primes;
2 is in the sequence since 311, 313, and 317 are all primes;
3 is not in the sequence since 3141, 3143, 3147, and 3149 are all composites;
4 is not in the sequence since 31411, 31413, 31417, and 31419 are all composites;
5 is in the sequence since 314159 is a prime; etc.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Union[PrimeQ[ 10 IntegerPart[10^n*Pi] + {1, 3, 7, 9}]][[-1]]; k = -1; lst = {}; While[k < 17001, If[ fQ@ k, AppendTo[lst, k + 1]; Print[k + 1]]; k++]; lst
    Module[{nn=16300,pd},pd=RealDigits[Pi,10,nn][[1]];Select[Range[0,nn],AnyTrue[ 10*FromDigits[Take[pd,#]]+{1,3,7,9},PrimeQ]&]] (* Harvey P. Dale, Aug 14 2022 *)
  • PARI
    is(n)=my(d=Pi*10^n\10*10);isprime(d+1) || isprime(d+3) || isprime(d+7) || isprime(d+9) \\ Charles R Greathouse IV, Nov 07 2013

Extensions

Keyword "base" added by Zak Seidov, Nov 11 2013

A242835 Primes formed by the initial digits of the decimal expansion of the square root of 5.

Original entry on oeis.org

2, 223, 22360679774997896964091
Offset: 1

Views

Author

Felix Fröhlich, May 23 2014

Keywords

Comments

There is no other term with less than 111 digits.
a(4) has 1506 digits. - Hiroaki Yamanouchi, Sep 11 2014

Examples

			Decimal expansion of sqrt(5) begins: 2.23606797749978969640917366... - _Wesley Ivan Hurt_, May 26 2014
		

Crossrefs

Cf. A002163 (Decimal Expansion of sqrt(5)).

Programs

  • Mathematica
    Module[{d=25,f},f=RealDigits[Sqrt[5],10,d][[1]];Select[ Table[ FromDigits[ Take[f,n]],{n,d}],PrimeQ]] (* Harvey P. Dale, Oct 29 2020 *)

A343422 Number of digits of earliest prime encountered at each digit n of the decimal expansion of Pi.

Original entry on oeis.org

1, 5, 2, 7, 1, 13, 1, 3, 1, 1, 1, 2, 2, 1, 4, 1, 1, 1, 3057, 6, 3490, 1, 3, 2, 1, 1, 2, 1, 1, 1, 20, 1, 1, 1, 9, 4, 2, 2, 2, 1, 4, 7, 6329, 1, 53, 3, 1, 1, 1, 19128, 1, 1, 4, 1, 2, 2, 1, 12, 39, 45, 35, 1, 30, 1, 1, 1, 1, 4834, 24, 341, 86, 127, 127, 1, 143
Offset: 1

Views

Author

Bill McEachen, Aug 21 2021

Keywords

Comments

The underlying approach is an alternate way to spawn primes from Pi (and other irrational values) compared to A005042. Generally speaking, there should be a prime for every known digit (sequence is likely infinite, use -1 for any term without solution). By its construction, every prime will not be encountered, and primes will be repeated, especially 2,3,5 and 7. Large primes will be seen within the prime sequence. Note that concatenations with leading 0 will duplicate that of the subsequent concatenation having nonzero leading digit.
The corresponding primes are: 3, 14159, 41, 1592653, 5, 9265358979323, 2, 653, 5, 3, 5, 89, 97, 7, 9323, 3, 2, 3, ....

Examples

			The first term is the trivial prime 3, having length=1 digit, so a(1)=1.
The next evaluation starts at digit 1:  1 is not prime, 14 is composite, 141 is composite, 1415 is composite, but 14159 is prime, so a(2)=5.
The next evaluation starts at digit 4:  4 is composite, 41 is prime, so a(3)=2.
The 33rd and 34th digits of Pi are 0 and 2, and "02" converts to 2, a 1-digit prime.  Thus, a(33) = 1.
		

Crossrefs

Programs

  • PARI
    lista(p) = {default(realprecision, p); my(x=Pi, nb=#Str(x), d=digits(floor(x*10^(nb-1)))); for (i=1, #d, my(k=i, j=d[i]); while (! ispseudoprime(j), k++; if (k>#d, j=0; break, j = 10*j+d[k])); if (j==0, break, print1(#Str(j), ", ")););} \\ Michel Marcus, Sep 15 2021
    
  • Python
    from sympy import S, isprime
    pi_digits = str(S.Pi.n(10**5+1)).replace(".", "")[:-1]
    def a(n):
        s, k = pi_digits[n-1], 1
        while not isprime(int(s)):
            s, k = s + pi_digits[n-1+k], k + 1
        return len(str(int(s)))
    print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Aug 21 2021

Formula

a(A153031(n)) = 1. - Michel Marcus, Aug 22 2021

A371224 Least prime factor of the integer formed by the first n decimal digits of Pi, or 0 if that number is prime.

Original entry on oeis.org

0, 0, 2, 3, 5, 0, 2, 2, 3, 3, 5, 2, 13, 163, 43, 13, 2, 317213509, 2, 2, 2, 2, 2, 2, 83, 41, 2, 3, 2, 3, 3, 5, 2, 2, 2, 2, 2, 0, 13, 59, 3, 2, 3, 3, 3, 3, 3, 31, 3, 1657, 2, 3, 2, 2, 2, 29, 13, 2, 3, 2, 2, 5, 2828293681646068747, 2, 3, 2, 223, 2, 7
Offset: 1

Views

Author

M. F. Hasler, Mar 15 2024

Keywords

Comments

Complementary to the sequences A005042 (primes in the initial digits of Pi) and A060421 which lists numbers N such that the first N digits of Pi form a prime - exactly the indices of zeros in the present sequence.

Crossrefs

Cf. A000796 (decimals of Pi), A005042 (primes in A011545), A011545 (integer made of n+1 initial digits of Pi), A060421 (length of A005042(n)), A020639 (smallest prime factor of n), A000040 (primes), A089281 (smallest prime factor of A011545(n)).

Programs

  • PARI
    a(n, c=Pi)={ if( n>=precision(c), error("insufficient precision"), !ispseudoprime(c\10^-n--), factor(c\.1^n)[1,1], 0)}

Formula

a(n) = 0 <=> n is in A060421 <=> A011545(n-1) is in A000040 (primes).
a(n) = A089281(n) = A020639(A011545(n-1)) whenever a(n) is nonzero.
a(n) = 2 <=> A000796(2-n) is even <=> A011545(n-1) is even.
Previous Showing 21-29 of 29 results.