OFFSET
1,2
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
EXAMPLE
3 = 10 in balanced ternary (bt) notation, 1+0 = 1, so 3 is in the list;
...
11 = 11T in bt notation, 1+1+T = 1, here T represent -1, so 11 is in the list;
13 = 111 in bt notation, 1+1+1 = 3, so 13 is NOT in the list.
MATHEMATICA
BTDigits[m_Integer,
g_] :=(*This is to determine digits of a number in balanced \
ternary notation.*)
Module[{n = m, d, sign, t = g},
If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
While[Length[t] < d, PrependTo[t, 0]];
t[[Length[t] + 1 - d]] = sign;
t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
n = 0; Table[While[n++; g = {}; bt = BTDigits[n, g]; s = Total[bt];
Abs[s] != 1]; n, {i, 1, 61}]
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Lei Zhou, Mar 16 2017
STATUS
approved