login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A233574 a(n) is the smallest term of either A233010 or A233572 such that |n-a(n)|<a(n) is a term of one of the two sequences. 1
0, 1, 2, 2, 4, 3, 4, 6, 8, 6, 6, 8, 8, 7, 12, 8, 10, 9, 10, 13, 12, 13, 16, 20, 16, 18, 26, 18, 18, 20, 18, 18, 20, 20, 18, 26, 20, 24, 26, 21, 24, 21, 26, 43, 32, 24, 28, 26, 28, 43, 30, 27, 28, 27, 28, 54, 30, 39, 40, 32, 32, 43, 32, 39, 40, 39, 40, 43, 36 (list; graph; refs; listen; history; text; internal format)
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

a(19)=13 since 19=13+6=A233010(9)+A233572(3) and 13>6. There is no number in A233010 or A233572 smaller than 13 that satisfies the same condition.

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

Cf. A002113, A061917, A006995, A057890, A134027, A233010, A233571, A233572, A233573

Sequence in context: A233511 A205793 A178431 * A157927 A227256 A328774

Adjacent sequences:  A233571 A233572 A233573 * A233575 A233576 A233577

KEYWORD

nonn,base,easy

AUTHOR

Lei Zhou, Dec 13 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 26 23:05 EST 2020. Contains 331289 sequences. (Running on oeis4.)