Calculate the sum of the binary digits of $x_n^3$, being $x_n$ an integer expressed in base 2

186 Views Asked by At

The integer $x_n$ expressed in base $2$ is a number $$ [x_n]_2=\underbrace{11...1}_{n}\underbrace{00...0}_{n} $$ with $n \geq 2$.

Calculate the sum of the binary digits of $x_n^3.$

I have no clue about this. How am I supposed to know anything about $x_n$? Any hints?

2

There are 2 best solutions below

0
On

You are supposed to recognize that the series of $1$s corresponds to $2^n-1$, so the whole number is $2^{2n}-2^n$. For this purpose the $0$s at the end do not matter so you can just work with $2^n-1$. You should be able to cube this and find a pattern in the $1$s in binary.

0
On

Since $x_n = 2^{2n}-2^n = (2^n-1)2^n$, we have $$x_n^3 = (2^n-1)^3 2^{3n} = 2^{6n} - 3\cdot 2^{5n} + 3\cdot 2^{4n} - 2^{3n}\\ = \underbrace{(2^n - 1 - 2)}_{n-1\text{ one}}2^{5n} + \underbrace{2^{4n+1}}_{1\text{ one}} + \underbrace{(2^n-1)}_{n\text{ one}}2^{3n} $$ When $n \ge 2$, the three group of set bits in above binary representation of $x_n^3$ doesn't overlap. This means the sum of binary digit of $x_n^3$ is $(n-1) + 1 + n = 2n$.