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.

A003618 Largest n-digit prime.

Original entry on oeis.org

7, 97, 997, 9973, 99991, 999983, 9999991, 99999989, 999999937, 9999999967, 99999999977, 999999999989, 9999999999971, 99999999999973, 999999999999989, 9999999999999937, 99999999999999997, 999999999999999989, 9999999999999999961, 99999999999999999989
Offset: 1

Views

Author

Keywords

Comments

Since 10^n - 1 is always a multiple of 9, one could be tempted to think that 9 is the least frequently occurring least significant digit in terms of this sequence. - Alonso del Arte, Dec 03 2017
The occurrences of least significant digits in the first 8000 terms (see A033874) are 1: 2028, 3: 2032, 7: 2014, and 9: 1926. - Giovanni Resta, Mar 16 2020

Examples

			No power of 10 is prime.
9 = 3^2, 8 = 2^3 but 7 is prime, so a(1) = 7.
99 = 3^2 * 11 but 97 is prime, so a(2) = 97.
999 = 3^3 * 37 but 997 is prime, so a(3) = 997.
9999 = 3^2 * 11 * 101, 9997 = 13 * 769, 9995 = 5 * 1999, 9993 = 3 * 3331, 9991 = 97 * 103, ..., 9975 = 5^2 * 399, but 9973 is prime, so a(4) = 9973.
		

References

  • O'Hara, J. Rec. Math., 22 (1990), Table on page 278.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003617, A033874, A114429 (largest n-digit twin prime).

Programs

Extensions

More terms from Stefan Steinerberger, Apr 08 2006

A092250 Lesser of the greatest twin prime pair with n digits.

Original entry on oeis.org

5, 71, 881, 9929, 99989, 999959, 9999971, 99999587, 999999191, 9999999701, 99999999761, 999999999959, 9999999998489, 99999999999971, 999999999997967, 9999999999999641, 99999999999998807, 999999999999998927
Offset: 1

Views

Author

Cino Hilliard, Feb 17 2004

Keywords

Comments

Sum of reciprocals = 0.215331408...
Also the numerator of the largest prime-over-prime fraction less than 1 that is the ratio of two primes both less than 10^n. - Cino Hilliard, Feb 13 2006 [edited by Jon E. Schoenfield, Dec 01 2019]

Crossrefs

Cf. A092245.
Cf. A114429(n) = a(n)+2: largest twin prime < 10^n.

Programs

  • Mathematica
    Array[Block[{k = 10^# - 3}, While[! AllTrue[{k, k + 2}, PrimeQ], k -= 2]; k] &, 18]
  • PARI
    lasttwpr(n) = { sr=0; for(m=0,n, c=0; forstep(x=10^(m+1)-1,10^m,-2, if(isprime(x)&& isprime(x-2),print1(x-2",");sr+=1./(x-2);break) ) ); print(); print(sr) }
    
  • PARI
    apply( {A092250(n,p=10^n)=until(2==p-p=precprime(p-1),);p}, [1..22]) \\ avoids multiple isprime(): much faster! - M. F. Hasler, Jan 17 2022
    
  • Python
    from sympy import prevprime
    def a(n):
        p = prevprime(10**n); pp = prevprime(p)
        while p - pp != 2: p, pp = pp, prevprime(pp)
        return pp
    print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Jan 17 2022

A240170 Larger of the greatest cousin prime pair with n digits.

Original entry on oeis.org

7, 83, 971, 9887, 99881, 999983, 9999401, 99999551, 999999761, 9999999707, 99999999947, 999999998867, 9999999999083, 99999999999467, 999999999997841, 9999999999997031, 99999999999998717, 999999999999999161, 9999999999999996587, 99999999999999999803
Offset: 1

Views

Author

Abhiram R Devesh, Aug 02 2014

Keywords

Comments

The sum of the reciprocals converges to 0.156047....
It is only a (plausible) conjecture that this sequence is well-defined. See A152052. - N. J. A. Sloane, Aug 22 2014

Crossrefs

Analogous sequences with twin primes:
- A092245 Lesser of the first twin prime pair with n digits.
- A114429 Larger of the greatest twin prime pair with n digits.

Programs

  • PARI
    a(n)=p=precprime(10^n);while(!isprime(p-4),p=precprime(p-1));return(p)
    vector(50, n, a(n)) \\ Derek Orr, Aug 04 2014
  • Python
    import sympy
    for i in range(1,100):
        a=(10**i)
        p=sympy.prevprime(a)
        while sympy.isprime(p-4)==False:
            p=sympy.prevprime(p)
        print(p)
    
Showing 1-3 of 3 results.