OFFSET
1,3
LINKS
Hans Havermann, Table of n, a(n) for n = 1..210 (terms 1..151 from Giovanni Resta).
Hans Havermann, pdf file showing the corresponding A350573 terms and illustrating the ternary embeddings (for terms 1..210).
EXAMPLE
12101 = base 10 -> 121{12101}2 = base 3.
PROG
(Python)
from sympy.ntheory.digits import digits
from itertools import count, islice, product
def agen(): # generator of terms
yield 0
for d in count(1):
for first in "12":
for rest in product("012", repeat=d-1):
s = first + "".join(rest)
if s in "".join(str(d) for d in digits(int(s), 3)[1:]):
yield int(s)
print(list(islice(agen(), 31))) # Michael S. Branicky, Jan 08 2022
(Python)
from itertools import count, islice
from gmpy2 import digits
def A038103_gen(): return (int(s) for s in (digits(n, 3) for n in count(0)) if s in digits(int(s), 3))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Feb 15 1999
STATUS
approved