login

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

Base-10 version of A038103 interpreted as base 3.
3

%I #17 Jan 09 2022 22:49:16

%S 0,1,2,3,6,7,11,12,21,22,23,24,31,41,43,62,145,146,149,152,2626,2627,

%T 4370,8463,8466,13562,20841,42320,43171,46609,47749,48150,52723,55179,

%U 55180,55181

%N Base-10 version of A038103 interpreted as base 3.

%H Hans Havermann, <a href="/A350573/b350573.txt">Table of n, a(n) for n = 1..210</a>

%t B3[n_] := FromDigits[IntegerDigits[n, 3]]

%t SP[n_] := (b = B3[n]; StringPosition[ToString[B3[b]], ToString[b]])

%t n=0; t={}; While[n<10^6, If[SP[n]!={}, AppendTo[t, n]]; n++]; t

%o (Python)

%o from sympy.ntheory.digits import digits

%o from itertools import count, islice, product

%o def agen(): # generator of terms

%o yield 0

%o for d in count(1):

%o for first in "12":

%o for rest in product("012", repeat=d-1):

%o s = first + "".join(rest)

%o if s in "".join(str(d) for d in digits(int(s), 3)[1:]):

%o yield int(s, 3)

%o print(list(islice(agen(), 36))) # _Michael S. Branicky_, Jan 06 2022

%o (Python)

%o from itertools import count, islice

%o from gmpy2 import digits

%o def A350573_gen(): return (n for n in count(0) if (s:=digits(n,3)) in digits(int(s),3))

%o A350573_list = list(islice(A350573_gen(),30)) # _Chai Wah Wu_, Jan 09 2022

%Y Cf. A038103, A350572.

%K nonn,base

%O 1,3

%A _Hans Havermann_, Jan 06 2022