login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A185201
10^n - second largest prime less than 10^n.
1
5, 11, 9, 33, 11, 21, 27, 29, 71, 57, 53, 39, 137, 29, 53, 83, 23, 33, 57, 27, 113, 71, 53, 303, 321, 249, 107, 261, 53, 17, 81, 119, 47, 513, 237, 179, 123, 123, 173, 27, 203, 137, 119, 77, 119, 147, 83, 47, 183, 161, 333, 339, 611, 579
OFFSET
1,1
REFERENCES
D. E. Knuth, The Art of Computer Programming, Second Edition, Vol. 2, Seminumerical Algorithms, Chapter 4.5.4 Factoring into Primes, Table 1, Page 390, Addison-Wesley, Reading, MA, 1981.
LINKS
FORMULA
a(n) = 10^n - precprime(precprime(10^n)-1)
EXAMPLE
a(1) = 5 because precprime(10) = 7, and precprime(6) = 5.
From M. F. Hasler, Jul 19 2024: (Start)
Further examples: (where pp = prevprime = A151799)
n | pp(pp(10^n)) | a(n)
----+-----------------+------
1 | 5 | 5
2 | 89 | 11
3 | 991 | 9
4 | 9967 | 33
5 | 99989 | 11
6 | 999979 | 21
7 | 9999973 | 27
8 | 99999971 | 29
9 | 999999929 | 71
10 | 9999999943 | 57
11 | 99999999947 | 53
12 | 999999999961 | 39
13 | 9999999999863 | 137
14 | 99999999999971 | 29
15 | 999999999999947 | 53
(End)
MAPLE
seq(10^n - prevprime(prevprime(10^n)), n=1..100); # Robert Israel, May 28 2017
MATHEMATICA
Table[10^n - NextPrime[10^n, -2], {n, 1, 50}] (* G. C. Greubel, Jun 24 2017 *)
PROG
(PARI) apply( {A185201(n)=10^n-precprime(precprime(10^n)-1)}, [1..66]) \\ M. F. Hasler, Jul 19 2024
CROSSREFS
Cf. A033874.
Cf. A003618 (largest prime < 10^n), A151799 (prevprime function).
Sequence in context: A356480 A075261 A254766 * A378700 A112956 A258995
KEYWORD
nonn
AUTHOR
Washington Bomfim, Jan 24 2012
STATUS
approved