OFFSET
2,3
COMMENTS
a(n) is the smallest integer that makes A379049(a(n)) = n.
Conjecture: a(n) is defined for all integer n > 1.
EXAMPLE
For n = 2, A379049(0) = 1 + 1 = 2. Thus a(2) = 0;
For n = 3, A379049(1) = 2 + 1 = 3, since 1's balanced ternary representation is 1. Thus a(3) = 1;
For n = 4, A379049(3) = 3 + 1 = 4, since 3's balanced ternary representation is 10. Thus a(4) = 3;
...
For n = 60, A379049(39366) = 31 + 29 = 60, since 39366's balanced ternary representation is 1T000000000, where the 11's digit is 1 represents the 11's prime 31 in the term before the plus sign, and the 10's digit is T representing the 10's prime 29 in the term after the plus sign. And evaluation of A379049 found no number i smaller than 39366 can make A379049(i) = 60. Thus a(60) = 39366.
MATHEMATICA
BTDigits[m_Integer, g_] := 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];
goal = 62; res = {}; ct = 1;
Do[AppendTo[res, 0], {i, 2, goal}]; i = -1; While[ct < goal, i++; BT = BTDigits[i, {0}]; BTl = Length[BT]; f = 1; b = 1; Do[If[BT[[j]] == 1, f = f*Prime[BTl - j + 1]]; If[BT[[j]] == -1, b = b*Prime[BTl - j + 1]], {j, 1, BTl}]; d = f + b; If[(d <= goal) && (res[[d - 1]] == 0), res[[d - 1]] = i; ct++]];
res
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Lei Zhou, Dec 19 2024
STATUS
approved
