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

A242973 Positions in both e and Pi where both digits in the same position are prime.

Original entry on oeis.org

1, 5, 9, 16, 17, 18, 25, 29, 30, 34, 40, 54, 64, 65, 74, 77, 84, 90, 92, 94, 100, 103, 112, 115, 124, 132, 136, 137, 138, 143, 144, 159, 178, 179, 180, 195, 204, 211, 217, 236, 242, 253, 275, 283, 286, 293, 302, 303, 305, 307, 317, 321, 326, 334, 339, 344, 347
Offset: 1

Views

Author

Philip Mizzi, May 28 2014

Keywords

Examples

			Pi = 3.1415926535897932384626...
.....|....|...|......|||........
_e = 2.7182818284590452353602...
		

Crossrefs

Programs

  • Mathematica
    Module[{digs=350,p,e,th},p=RealDigits[Pi,10,digs][[1]];e=RealDigits[E,10,digs][[1]];th = Thread[{p,e}];Position[If[AllTrue[#,PrimeQ],1,0]&/@th,1]]//Flatten (* Harvey P. Dale, Jan 28 2023 *)
  • PARI
    \p 1000
    e=Vec(Str(exp(1)/10)); p=Vec(Str(Pi/10)); for(n=1, #e-9, if(isprime(eval(e[n+2])) && isprime(eval(p[n+2])), print1(n", "))) \\ Jens Kruse Andersen, Jul 23 2014

Extensions

Definition clarified by Harvey P. Dale, Jan 28 2023

A242975 Positions in e and Pi where the digit at each position is equal and prime.

Original entry on oeis.org

17, 18, 34, 40, 100, 143, 275, 326, 334, 365, 412, 420, 453, 501, 504, 507, 610, 622, 642, 743, 825, 840, 841, 864, 866, 875, 878, 898, 920, 926, 941, 948, 956, 963, 1009, 1054, 1059, 1078, 1147, 1158, 1180, 1203, 1283, 1292, 1306, 1338, 1355, 1362, 1407, 1469
Offset: 1

Views

Author

Philip Mizzi, May 28 2014

Keywords

Examples

			Pi = 3.1415926535897932384626...
......................||........
_e = 2.7182818284590452353602...
		

Crossrefs

Programs

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
Showing 1-3 of 3 results.