OFFSET
0,3
COMMENTS
It is conjectured that a(n) exists for all n >= 0.
LINKS
Lei Zhou, Table of n, a(n) for n = 0..10000
EXAMPLE
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];
BTpaleQ[n_Integer] :=
(*This is to query if a number is an element of sequence A233010.*)
Module[{t, trim = n/3^IntegerExponent[n, 3]},
t = BTDigits[trim, {0}]; t == Reverse[t]];
BTrteQ[n_Integer] :=
(*This is to query if a number is an element of sequence A233572.*)
Module[{t, trim = n/3^IntegerExponent[n, 3]},
t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
sa = Select[Range[0, 30000], BTpaleQ[#] &];
(*This is to generate a limited list of A233010.*)
sb = Select[Range[0, 30000], BTrteQ[#] &];
(*This is to generate a limited list of A233572.*)
range = 68; Table[i1 = 0; i2 = 0;
While[If[sa[[i1 + 1]] < sb[[i2 + 1]], i1++; nh = sa[[i1]]; isa = 1,
i2++; nh = sb[[i2]]; isa = 0]; (2*nh) < n];
While[If[isa == 0, chk = MemberQ[sa, Abs[n - nh]],
chk = MemberQ[sb, Abs[n - nh]]]; ! chk,
If[sa[[i1 + 1]] < sb[[i2 + 1]], i1++; nh = sa[[i1]]; isa = 1, i2++;
nh = sb[[i2]]; isa = 0]];
If[isa == 0, m = sb[[i2]], m = sa[[i1]]]; m, {n, 0, range}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Lei Zhou, Dec 13 2013
STATUS
approved