login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A090537
Least n-digit prime using digit 3 once and rest all 1, or 0 if no such prime exists.
4
3, 13, 113, 0, 11113, 113111, 0, 11111131, 111111113, 0, 11111111113, 111113111111, 0, 31111111111111, 0, 0, 11111111113111111, 111111111111111131, 0, 11111111111111111131, 131111111111111111111, 0, 11111111111111111311111
OFFSET
1,1
FORMULA
a(3n+1) = 0.
PROG
(Python)
from sympy import isprime
def agen():
digits = 0
while True:
for i in range(digits+1):
t = int("1"*(digits-i) + "3" + "1"*i)
if isprime(t): yield t; break
else: yield 0
digits += 1
g = agen()
print([next(g) for i in range(23)]) # Michael S. Branicky, Mar 13 2021
CROSSREFS
Without zeros, subsequence of A107689.
Sequence in context: A223911 A006860 A181083 * A063269 A105431 A360187
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Dec 08 2003
EXTENSIONS
More terms from David Wasserman, Jan 03 2006
STATUS
approved