login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #25 Jan 22 2019 08:46:53

%S 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,

%T -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,

%U 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

%N 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).

%C 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.

%C All row sums are equal to 0.

%C Ignoring zero terms, we obtain an alternating sequence of 1,-1 (A033999).

%C Sequence of numbers having no 0's in the binary balanced system is A002450.

%C Minimal number having n >= 0 zeros in the binary balanced system is A000079(n).

%H David A. Corneth, <a href="/A270885/b270885.txt">Table of n, a(n) for n = 1..10020</a> (first 1003 rows flattened)

%H David A. Corneth, <a href="/A270885/a270885.gp.txt">n, row(n); Representation of n in the binary balanced system for n = 1..1003</a>

%H Vladimir Shevelev, <a href="http://arxiv.org/abs/1603.04434">Two analogs of Thue-Morse sequence</a>, arXiv:1603.04434 [math.NT], 2016.

%e 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.

%e Then 7 = 2^3 - 2^2 + 2^2 - 2^1 + 2^1 - 1 = 2^3 - 1 = 100-1_b.

%e In the binary balanced system we have the representations (irregular triangle)

%e 1 = {1,-1}

%e 2 = {1,-1,0}

%e 3 = {1,0,-1}

%e 4 = {1,-1,0,0}

%e 5 = {1,-1,1,-1}

%e 6 = {1,0,-1,0}

%e 7 = {1,0,0,-1}

%e 8 = {1,-1,0,0,0}

%e 9 = {1,-1,0,1,-1}

%e 10 = {1,-1,1,-1,0}

%e ...

%t Array[Plus @@ {PadRight[#, Length[#] + 1], -PadLeft[#, Length[#] + 1]} &@ IntegerDigits[#, 2] &, {21}] // Flatten (* _Michael De Vlieger_, Mar 25 2016 *)

%o (PARI) row(n) = {b=concat(0, binary(n)); for(i=2, #b, if(b[i] == 1, b[i-1] += 1; b[i] = -1)); b}

%o 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

%Y Cf. A000079, A002450, A033999, A039724, A140267, A268411.

%K sign,base,tabf

%O 1

%A _Vladimir Shevelev_, Mar 25 2016

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:56 EDT 2024. Contains 371964 sequences. (Running on oeis4.)