OFFSET
0,3
COMMENTS
Suppose that b = (b(0), b(1), ... ) is an increasing sequence of positive integers satisfying b(0) = 1 and b(n+1) <= 2*b(n) for n >= 0. Let B(n) be the least b(m) >= n. Let R(0) = 1, and for n > 0, let R(n) = B(n) - R(B(n) - n). The resulting sum of the form R(n) = B(n) - B(m(1)) + B(m(2)) - ... + ((-1)^k)*B(k) is the minimal alternating b-representation of n. The sum B(n) + B(m(2)) + ... is the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... , the nonpositive part of R(n). The number ((-1)^k)*B(k) is the trace of n. If b(n) = n(n+1)/2, the n-th triangular number, then the sum R(n) is the minimal alternating triangular-number representation of n.
LINKS
Clark Kimberling, Table of n, a(n) for n = 0..1000
EXAMPLE
R(0) = 0
R(1) = 1
R(2) = 3 - 1
R(3) = 3
R(4) = 6 - 3 + 1
R(5) = 6 - 1
R(8) = 10 - 3 + 1
R(11) = 15 - 6 + 3 - 1
MATHEMATICA
b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}];
s[n_] := Table[b[n], {k, 1, n}];
h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
g = h[100]; r[0] = {0};
r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
t = Table[r[n], {n, 0, 120}] (* A255974 actual representations *)
Flatten[t] (* A255974 sequence *)
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Clark Kimberling, Apr 11 2015
STATUS
approved