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.

A003618 Largest n-digit prime.

This page as a plain text file.
%I A003618 M4452 #68 Feb 16 2025 08:32:27
%S A003618 7,97,997,9973,99991,999983,9999991,99999989,999999937,9999999967,
%T A003618 99999999977,999999999989,9999999999971,99999999999973,
%U A003618 999999999999989,9999999999999937,99999999999999997,999999999999999989,9999999999999999961,99999999999999999989
%N A003618 Largest n-digit prime.
%C A003618 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
%C A003618 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
%D A003618 O'Hara, J. Rec. Math., 22 (1990), Table on page 278.
%D A003618 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A003618 Giovanni Resta, <a href="/A003618/b003618.txt">Table of n, a(n) for n = 1..1000</a> (terms 1..200 from T. D. Noe. _Jon E. Schoenfield_ verified that terms 1..200 are indeed primes, Feb 02 2009)
%H A003618 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PreviousPrime.html">Previous Prime</a>
%H A003618 R. G. Wilson, v., <a href="/A003617/a003617.pdf">Extract from letter to N. J. A. Sloane, May 20 1994</a>, with annotated scanned copy of page 278 of O'Hara article.
%e A003618 No power of 10 is prime.
%e A003618 9 = 3^2, 8 = 2^3 but 7 is prime, so a(1) = 7.
%e A003618 99 = 3^2 * 11 but 97 is prime, so a(2) = 97.
%e A003618 999 = 3^3 * 37 but 997 is prime, so a(3) = 997.
%e A003618 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.
%p A003618 a:= n-> prevprime(10^n):
%p A003618 seq(a(n), n=1..20);  # _Alois P. Heinz_, Feb 11 2021
%t A003618 NextPrime[10^Range[20], -1] (* _Harvey P. Dale_, Feb 03 2011 *)
%o A003618 (PARI) a(n)=precprime(10^n) \\ _Charles R Greathouse IV_, Jul 19 2011
%o A003618 (Magma) [PreviousPrime(10^n): n in [1..20]]; // _Vincenzo Librandi_, Sep 13 2016
%o A003618 (Python)
%o A003618 from sympy import prevprime
%o A003618 print([prevprime(10**n) for n in range(1, 21)]) # _Michael S. Branicky_, Feb 11 2021
%Y A003618 Cf. A003617, A033874, A114429 (largest n-digit twin prime).
%K A003618 nonn,nice,base
%O A003618 1,1
%A A003618 _N. J. A. Sloane_, _Mira Bernstein_
%E A003618 More terms from _Stefan Steinerberger_, Apr 08 2006