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.
%I A340544 #34 Feb 15 2021 07:15:31 %S A340544 5,11,29,44,50,83,98,104,116,128,140,146,245,260,266,278,290,302,308, %T A340544 332,344,377,380,395,401,410,416,434,449,455,731,746,752,764,776,788, %U A340544 794,818,830,863,866,881,887,896,902,920,935,941,980,992,1025,1028,1043 %N A340544 Numbers from A340131 that are not multiples of 3. %C A340544 Terms are reduced, i.e., ternary codes do not have trailing zeros. %C A340544 The term is a digitized Motzkin path that starts with an up step and ends with a down step. Such a path has neither leading nor final flat steps, i.e., the ternary code of the corresponding term has no finite 0's. Recall that in ternary code, 1's are up steps, and 2's are down steps. %C A340544 The number of terms with a ternary code of length k is A026107(k-1). For instance, 7 (seven) reduced terms 83, 98, 104, 116, 128, 140, and 146 have a ternary length of 5, namely 10002, 10122, 10212, 11022, 11202, 12012, and 12102. Respectively A026107(4) = 7. %H A340544 Gennady Eremin, <a href="/A340544/b340544.txt">Table of n, a(n) for n = 1..1000</a> %H A340544 Kurt Mahler, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa53/aa5316.pdf">The representation of squares to the base 3</a>, Acta Arith. Vol. 53, Issue 1 (1989), p. 105. %o A340544 (Python) %o A340544 def digits(n, b): %o A340544 out = [] %o A340544 while n >= b: %o A340544 out.append(n % b) %o A340544 n //= b %o A340544 return [n] + out[::-1] %o A340544 def ok(n): %o A340544 if n%3 == 0: return False %o A340544 t = digits(n, 3) %o A340544 if t.count(1) != t.count(2): return False %o A340544 return all(t[:i].count(1) >= t[:i].count(2) for i in range(1, len(t))) %o A340544 print([n for n in range(750) if ok(n)]) # after _Michael S. Branicky_ (A340131) %Y A340544 Intersection of A001651 and A340131. %Y A340544 Subsequences: A134752, A168607. %Y A340544 Cf. A026107. %K A340544 nonn,easy,base %O A340544 1,1 %A A340544 _Gennady Eremin_, Jan 11 2021