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 A174657 #16 May 06 2021 22:12:49 %S A174657 5,14,15,17,23,41,42,43,44,45,47,50,51,53,59,68,69,71,77,95,122,123, %T A174657 124,125,126,127,128,129,131,132,133,134,135,137,140,141,143,149,150, %U A174657 151,152,153,155,158,159,161,167,176,177,179,185,203,204,205,206,207,209 %N A174657 Balanced ternary numbers with more negative trits than positive trits. %C A174657 Numbers for which the sum of trits is negative. %H A174657 Daniel Forgues, <a href="/A174657/b174657.txt">Table of n, a(n) for n=1..32685</a> %t A174657 (* First run the program for A065363 to define balTernDigits *) Select[Range[210], Count[balTernDigits[#], -1] > Count[balTernDigits[#], 1] &] (* _Alonso del Arte_, Feb 26 2011 *) %o A174657 (Python) %o A174657 def a(n): %o A174657 s=0 %o A174657 x=0 %o A174657 while n>0: %o A174657 x=n%3 %o A174657 n//=3 %o A174657 if x==2: %o A174657 x=-1 %o A174657 n+=1 %o A174657 s+=x %o A174657 return s %o A174657 print([n for n in range(301) if a(n)<0]) # _Indranil Ghosh_, Jun 07 2017 %Y A174657 Cf. A174658, A174659, A065363, A140267. %K A174657 base,nonn %O A174657 1,1 %A A174657 _Daniel Forgues_, Mar 26 2010