OFFSET
1,2
COMMENTS
"Simply connected" means that there must not be a "hole" in the set of digits. E.g., {1,2,4} would not be allowed since '3' is missing.
PROG
(PARI) is(n)={d=Set(digits(n)); d[1]==1 || (#d>1&&d[2]==1) || return; d[#d]==#d-!d[1]}
(Python)
def ok(n):
s = set(str(n)); return '1' in s and len(s) == ord(max(s))-ord(min(s))+1
def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
print(aupto(1223)) # Michael S. Branicky, Jan 10 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Dec 24 2014
STATUS
approved