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.

Original entry on oeis.org

2, 11, 113, 1117, 11113, 111119, 1111151, 11111117, 111111113, 1111111121, 11111111113, 111111111149, 1111111111139, 11111111111123, 111111111111229, 1111111111111123, 11111111111111119, 111111111111111131, 1111111111111111111, 11111111111111111131
Offset: 1

Views

Author

Gonzalo Martínez, Jun 11 2025

Keywords

Comments

This sequence differs from A096497: besides differing in the repunit primes (A004022), it also excludes terms containing the digit 0, such as A096497(53).
Repunits primes (A004022) are in this sequence. In fact, a(A004023(k)) = A004022(k), for all k >= 1.
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.

Examples

			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.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x;
    for x from (10^n-1)/9 by 2 do
      if isprime(x) and not member(0,convert(x,base,10)) then return x fi
    od
    end proc:
    f(1):= 2:
    map(f, [$1..20]); # Robert Israel, Jun 12 2025
  • Mathematica
    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 *)
  • PARI
    a(n) = forprime(p=(10^n-1)/9, , if (vecmin(digits(p)), return(p))); \\ Michel Marcus, Jun 15 2025
  • Python
    from itertools import product
    from sympy import isprime
    def a(n):
        for t in product('123456789', repeat=n):
            p = int(''.join(t))
            if isprime(p): return p
    print([a(n) for n in range(1, 21)])
    
  • Python
    from sympy import nextprime
    def A384873(n):
        m = nextprime((10**n-1)//9-1)
        while '0' in str(m):
            m = nextprime(m)
        return m # Chai Wah Wu, Jun 20 2025