cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A350573 #17 Jan 09 2022 22:49:16
%S A350573 0,1,2,3,6,7,11,12,21,22,23,24,31,41,43,62,145,146,149,152,2626,2627,
%T A350573 4370,8463,8466,13562,20841,42320,43171,46609,47749,48150,52723,55179,
%U A350573 55180,55181
%N A350573 Base-10 version of A038103 interpreted as base 3.
%H A350573 Hans Havermann, <a href="/A350573/b350573.txt">Table of n, a(n) for n = 1..210</a>
%t A350573 B3[n_] := FromDigits[IntegerDigits[n, 3]]
%t A350573 SP[n_] := (b = B3[n]; StringPosition[ToString[B3[b]], ToString[b]])
%t A350573 n=0; t={}; While[n<10^6, If[SP[n]!={}, AppendTo[t, n]]; n++]; t
%o A350573 (Python)
%o A350573 from sympy.ntheory.digits import digits
%o A350573 from itertools import count, islice, product
%o A350573 def agen(): # generator of terms
%o A350573     yield 0
%o A350573     for d in count(1):
%o A350573         for first in "12":
%o A350573             for rest in product("012", repeat=d-1):
%o A350573                 s = first + "".join(rest)
%o A350573                 if s in "".join(str(d) for d in digits(int(s), 3)[1:]):
%o A350573                     yield int(s, 3)
%o A350573 print(list(islice(agen(), 36))) # _Michael S. Branicky_, Jan 06 2022
%o A350573 (Python)
%o A350573 from itertools import count, islice
%o A350573 from gmpy2 import digits
%o A350573 def A350573_gen(): return (n for n in count(0) if (s:=digits(n,3)) in digits(int(s),3))
%o A350573 A350573_list = list(islice(A350573_gen(),30)) # _Chai Wah Wu_, Jan 09 2022
%Y A350573 Cf. A038103, A350572.
%K A350573 nonn,base
%O A350573 1,3
%A A350573 _Hans Havermann_, Jan 06 2022