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.

A384873 a(n) is the smallest n-digit zeroless prime.

This page as a plain text file.
%I A384873 #30 Jun 23 2025 22:21:42
%S A384873 2,11,113,1117,11113,111119,1111151,11111117,111111113,1111111121,
%T A384873 11111111113,111111111149,1111111111139,11111111111123,
%U A384873 111111111111229,1111111111111123,11111111111111119,111111111111111131,1111111111111111111,11111111111111111131
%N A384873 a(n) is the smallest n-digit zeroless prime.
%C A384873 This sequence differs from A096497: besides differing in the repunit primes (A004022), it also excludes terms containing the digit 0, such as A096497(53).
%C A384873 Repunits primes (A004022) are in this sequence. In fact, a(A004023(k)) = A004022(k), for all k >= 1.
%C A384873 With the exception of a(1) = 2, the terms begin with strings of 1's. The first term to include all positive even digits is a(1756) = 111....126843.
%H A384873 Gonzalo Martínez, <a href="/A384873/b384873.txt">Table of n, a(n) for n = 1..100</a>
%e A384873 The list of 3-digit prime numbers starts with 101, 103, 107, 109, and 113. Among these, 113 is the first that does not contain the digit 0. So, a(3) = 113.
%p A384873 f:= proc(n) local x;
%p A384873 for x from (10^n-1)/9 by 2 do
%p A384873   if isprime(x) and not member(0,convert(x,base,10)) then return x fi
%p A384873 od
%p A384873 end proc:
%p A384873 f(1):= 2:
%p A384873 map(f, [$1..20]); # _Robert Israel_, Jun 12 2025
%t A384873 a[n_]:=Module[{k=PrimePi[10^n/9-1]},Until[DigitCount[Prime[k],10,0]==0,k++];Prime[k]] (* _James C. McMahon_, Jun 21 2025 *)
%o A384873 (Python)
%o A384873 from itertools import product
%o A384873 from sympy import isprime
%o A384873 def a(n):
%o A384873     for t in product('123456789', repeat=n):
%o A384873         p = int(''.join(t))
%o A384873         if isprime(p): return p
%o A384873 print([a(n) for n in range(1, 21)])
%o A384873 (Python)
%o A384873 from sympy import nextprime
%o A384873 def A384873(n):
%o A384873     m = nextprime((10**n-1)//9-1)
%o A384873     while '0' in str(m):
%o A384873         m = nextprime(m)
%o A384873     return m # _Chai Wah Wu_, Jun 20 2025
%o A384873 (PARI) a(n) = forprime(p=(10^n-1)/9, , if (vecmin(digits(p)), return(p))); \\ _Michel Marcus_, Jun 15 2025
%Y A384873 Cf. A052382, A068693, A096497, A004022.
%K A384873 nonn,base
%O A384873 1,1
%A A384873 _Gonzalo Martínez_, Jun 11 2025