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.

A132153 Largest prime <= square root of 10^n.

Original entry on oeis.org

3, 7, 31, 97, 313, 997, 3137, 9973, 31607, 99991, 316223, 999983, 3162277, 9999991, 31622743, 99999989, 316227731, 999999937, 3162277633, 9999999967, 31622776589, 99999999977, 316227766003, 999999999989, 3162277660153, 9999999999971, 31622776601657
Offset: 1

Views

Author

Anthony C Robin, Nov 01 2007

Keywords

Comments

To check if an (n+1)-digit number is prime, a(n) is the largest prime which one needs to check is not a factor of the (n+1)-th digit number. For example, to check that a general four-digit number is not prime, we need to test its divisibility by all the primes up to and including 97.

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[Sqrt[10^n],-1],{n,27}] (* James C. McMahon, Mar 04 2025 *)
  • PARI
    a(n)=precprime(sqrtint(10^n)) \\ Charles R Greathouse IV, Aug 18 2011
    
  • Python
    from sympy import prevprime, integer_nthroot
    def a(n): return prevprime(integer_nthroot(10**n, 2)[0]+1)
    print([a(n) for n in range(1, 28)]) # Michael S. Branicky, Dec 23 2021

Formula

a(n) = A000040(A122121(n)). a(2n) = A003618(n). - R. J. Mathar, Nov 06 2007 [Corrected by Jaroslav Krizek, Jul 12 2010]
a(n) = sqrt(A175734(n)). - Jaroslav Krizek, Aug 24 2010

Extensions

More terms from N. J. A. Sloane, Jan 05 2008