OFFSET
1,3
LINKS
Hans Havermann, Table of n, a(n) for n = 1..210
MATHEMATICA
B3[n_] := FromDigits[IntegerDigits[n, 3]]
SP[n_] := (b = B3[n]; StringPosition[ToString[B3[b]], ToString[b]])
n=0; t={}; While[n<10^6, If[SP[n]!={}, AppendTo[t, n]]; n++]; t
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, 3)
print(list(islice(agen(), 36))) # Michael S. Branicky, Jan 06 2022
(Python)
from itertools import count, islice
from gmpy2 import digits
def A350573_gen(): return (n for n in count(0) if (s:=digits(n, 3)) in digits(int(s), 3))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hans Havermann, Jan 06 2022
STATUS
approved