|
|
A270885
|
|
Irregular triangle read by rows, listing the digits 1,0,-1 in the representation of n > 0 in the binary balanced system (cf. comment in A268411).
|
|
6
|
|
|
1, -1, 1, -1, 0, 1, 0, -1, 1, -1, 0, 0, 1, -1, 1, -1, 1, 0, -1, 0, 1, 0, 0, -1, 1, -1, 0, 0, 0, 1, -1, 0, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 0, 1, 0, -1, 1, -1, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, -1, 0, 0, 0, 0, 1, -1, 0, 0, 1, -1, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 1, -1, 0, 0, 1, -1, 1, -1, 1, -1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
The n-th row contains k pairs of 1,-1 if and only if the number of runs of 1's in the binary representation of n is k.
All row sums are equal to 0.
Ignoring zero terms, we obtain an alternating sequence of 1,-1 (A033999).
Sequence of numbers having no 0's in the binary balanced system is A002450.
Minimal number having n >= 0 zeros in the binary balanced system is A000079(n).
|
|
LINKS
|
|
|
EXAMPLE
|
Let n = 7 = 2^2 + 2 + 1. To convert this to the binary balanced system, every 2^i should be written in the form 2^(i+1) - 2^i.
Then 7 = 2^3 - 2^2 + 2^2 - 2^1 + 2^1 - 1 = 2^3 - 1 = 100-1_b.
In the binary balanced system we have the representations (irregular triangle)
1 = {1,-1}
2 = {1,-1,0}
3 = {1,0,-1}
4 = {1,-1,0,0}
5 = {1,-1,1,-1}
6 = {1,0,-1,0}
7 = {1,0,0,-1}
8 = {1,-1,0,0,0}
9 = {1,-1,0,1,-1}
10 = {1,-1,1,-1,0}
...
|
|
MATHEMATICA
|
Array[Plus @@ {PadRight[#, Length[#] + 1], -PadLeft[#, Length[#] + 1]} &@ IntegerDigits[#, 2] &, {21}] // Flatten (* Michael De Vlieger, Mar 25 2016 *)
|
|
PROG
|
(PARI) row(n) = {b=concat(0, binary(n)); for(i=2, #b, if(b[i] == 1, b[i-1] += 1; b[i] = -1)); b}
first(n) = {my(t = 0, i = 1); while(t < n, t+=(logint(i<<1, 2) + 1); i++); concat(vector(i, j, row(j)))} \\ David A. Corneth, Jan 21 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,base,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|