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.

A033874 Difference between the largest prime < 10^n (A003618) and 10^n.

This page as a plain text file.
%I A033874 #49 Feb 16 2025 08:32:36
%S A033874 3,3,3,27,9,17,9,11,63,33,23,11,29,27,11,63,3,11,39,11,101,27,23,257,
%T A033874 123,141,99,209,27,11,27,21,9,411,23,159,81,59,57,17,119,83,81,53,9,
%U A033874 33,41,33,57,57,323,231,177,291,111,593,93,149,141,161,39,83,123,51,269
%N A033874 Difference between the largest prime < 10^n (A003618) and 10^n.
%D A033874 Knuth, Art of Computer Programming, volume 2, pages 13 and 390.
%D A033874 Journal of Recreational Mathematics, volume 14, number 4, page 285.
%D A033874 Journal of Recreational Mathematics, volume 20 ,number 3, page 209-210.
%D A033874 O'Hara, J. Rec. Math., 22 (1990), Table on page 278.
%H A033874 Giovanni Resta, <a href="/A033874/b033874.txt">Table of n, a(n) for n = 1..8000</a> (first 1000 terms from T. D. Noe)
%H A033874 V. Danilov, <a href="http://web.archive.org/web/20080517213817/http://www.fortunecity.com/skyscraper/epson/276/pr1_10k.htm">Table for large n</a>
%H A033874 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PreviousPrime.html">Previous Prime</a>
%H A033874 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 A033874 a(4) = 27 because 10^4 - 9973 = 27. The 21st term is 101 since 10^21 - 101 = 999999999999999999899 is prime.
%p A033874 seq(10^n-prevprime(10^n),n=1..65); # _Emeric Deutsch_, Apr 20 2006
%t A033874 PrevPrime[ n_Integer ] := Module[ {k}, k = n - 1; While[ ! PrimeQ[ k ], k-- ]; k ]; Table[ 10^n - PrevPrime[ 10^n ], {n, 1, 75} ] (* _Robert G. Wilson v_, Sep 09 2000 *)
%t A033874 Table[10^i - NextPrime[10^i, -1], {i, 0, 70}] (* _Harvey P. Dale_, Jan 13 2011 *)
%o A033874 (PARI) a(n)=10^n-precprime(10^n) \\ _Charles R Greathouse IV_, Aug 03 2014
%o A033874 (Magma) [10^n-PreviousPrime(10^n): n in [1..65]]; // _Vincenzo Librandi_, Sep 13 2016
%Y A033874 Cf. A003618, A033873.
%K A033874 nonn,nice
%O A033874 1,1
%A A033874 Vasiliy Danilov (danilovv(AT)usa.net)
%E A033874 More terms from _Patrick De Geest_