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 A283800 #7 Mar 16 2017 22:34:13 %S A283800 1,3,5,7,9,11,15,17,19,21,23,25,27,29,33,35,43,45,47,49,51,53,55,57, %T A283800 59,61,63,65,69,71,73,75,77,79,81,83,87,89,95,97,99,101,105,107,113, %U A283800 127,129,133,135,137,139,141,143,145,147,151,153,155,157,159,161 %N A283800 Numbers such that the sum of trits of its balanced ternary representation is 1 or -1. %H A283800 Lei Zhou, <a href="/A283800/b283800.txt">Table of n, a(n) for n = 1..10000</a> %e A283800 3 = 10 in balanced ternary (bt) notation, 1+0 = 1, so 3 is in the list; %e A283800 ... %e A283800 11 = 11T in bt notation, 1+1+T = 1, here T represent -1, so 11 is in the list; %e A283800 13 = 111 in bt notation, 1+1+1 = 3, so 13 is NOT in the list. %t A283800 BTDigits[m_Integer, %t A283800 g_] :=(*This is to determine digits of a number in balanced \ %t A283800 ternary notation.*) %t A283800 Module[{n = m, d, sign, t = g}, %t A283800 If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n]; %t A283800 d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++]; %t A283800 While[Length[t] < d, PrependTo[t, 0]]; %t A283800 t[[Length[t] + 1 - d]] = sign; %t A283800 t = BTDigits[sign*(n - 3^(d - 1)), t]]; t]; %t A283800 n = 0; Table[While[n++; g = {}; bt = BTDigits[n, g]; s = Total[bt]; %t A283800 Abs[s] != 1]; n, {i, 1, 61}] %Y A283800 Cf. A065303, A174658. %K A283800 nonn,easy,base %O A283800 1,2 %A A283800 _Lei Zhou_, Mar 16 2017