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.

A065582 Smallest prime ending in exactly n 9's.

This page as a plain text file.
%I A065582 #34 Dec 08 2024 23:51:53
%S A065582 19,199,1999,49999,199999,2999999,19999999,799999999,10999999999,
%T A065582 59999999999,1099999999999,34999999999999,59999999999999,
%U A065582 499999999999999,14999999999999999,139999999999999999,1099999999999999999,20999999999999999999,29999999999999999999,2099999999999999999999
%N A065582 Smallest prime ending in exactly n 9's.
%C A065582 From _Jeppe Stig Nielsen_, Jul 30 2022: (Start)
%C A065582 Can decrease, for example a(25) < a(24). So not the same as Smallest prime ending in n or more 9s.
%C A065582 a(n) can contain other 9s as well, for example a(46), a(118), a(156). (End)
%H A065582 Hugo Pfoertner, <a href="/A065582/b065582.txt">Table of n, a(n) for n = 1..500</a> (first 100 terms from Harry J. Smith).
%t A065582 Do[a = Table[9, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 9 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
%o A065582 (PARI) a(n)={ my(t=10^n, b=t-1, d=0); while(!isprime(b + t*d), d++; if(d%10==9, d++)); b + t*d } \\ _Harry J. Smith_, Oct 23 2009
%o A065582 (Python)
%o A065582 from sympy import isprime
%o A065582 def a(n):
%o A065582     pow, end, i = 10**n, 10**n-1, 1
%o A065582     while i%10 == 9 or not isprime(i*pow + end): i += 1
%o A065582     return i*pow + end
%o A065582 print([a(n) for n in range(1, 20)]) # _Michael S. Branicky_, Jul 30 2022
%Y A065582 Cf. A037071, A065592, A065821, A065580, A065581.
%K A065582 nonn,base
%O A065582 1,1
%A A065582 _Robert G. Wilson v_, Nov 28 2001