This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A255974 #4 Apr 13 2015 09:38:49 %S A255974 0,1,3,-1,3,6,-3,1,6,-1,6,10,-3,10,-3,1,10,-1,10,15,-6,3,-1,15,-3,15, %T A255974 -3,1,15,-1,15,21,-6,1,21,-6,3,-1,21,-3,21,-3,1,21,-1,21,28,-6,28,-6, %U A255974 1,28,-6,3,-1,28,-3,28,-3,1,28,-1,28,36,-10,3,36,-6,36 %N A255974 R(k), the minimal alternating triangular-number representation of k, concatenated for k = 0, 1, 2,.... %C A255974 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. %H A255974 Clark Kimberling, <a href="/A255974/b255974.txt">Table of n, a(n) for n = 0..1000</a> %e A255974 R(0) = 0 %e A255974 R(1) = 1 %e A255974 R(2) = 3 - 1 %e A255974 R(3) = 3 %e A255974 R(4) = 6 - 3 + 1 %e A255974 R(5) = 6 - 1 %e A255974 R(8) = 10 - 3 + 1 %e A255974 R(11) = 15 - 6 + 3 - 1 %t A255974 b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}]; %t A255974 s[n_] := Table[b[n], {k, 1, n}]; %t A255974 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; %t A255974 g = h[100]; r[0] = {0}; %t A255974 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]] %t A255974 t = Table[r[n], {n, 0, 120}] (* A255974 actual representations *) %t A255974 Flatten[t] (* A255974 sequence *) %Y A255974 Cf. A000217, A256655 (Fibonacci based), A256696 (binary), A256789 (squares). %K A255974 easy,sign %O A255974 0,3 %A A255974 _Clark Kimberling_, Apr 11 2015