How many bits to represent this integer?

499 Views Asked by At

If $$x = \left(\frac{n+1}{4}\right)^{(n+1)/2},$$ then how many bits do we need to represent $x$ in binary?

1

There are 1 best solutions below

0
On

If $n = 2$ or any even integer not one less than a perfect square, you will need infinite digits to the right of the decimal point.

In all cases you will need $1 + \Big\lfloor\dfrac{n+1}{2}\log_2\Big(\dfrac{n+1}{4}\Big)\Big\rfloor$ digits to the left of the decimal point.

Let $d_r = $ digits needed to right of decimal point.

$d_r = \begin{cases} \frac{n+1}{2}, & \text{if } n \equiv 1 (\mod 4), \\ 0, & \text{if } n \equiv 3 (\mod 4), \\ n+1, & \text{if } n \equiv 0 (\mod 4)\text{ and } n=s^2-1, \\ \infty, & \text{otherwise}. \end{cases}$

Because:

  • $\text{if } n \equiv 1 (\mod 4)$, the base if of the form $p.1$, raised to $\frac{n+1}{2}$ power
  • $\text{if } n \equiv 3 (\mod 4)$, the base is a whole number
  • $\text{if } n \equiv 0 (\mod 4)\text{ and } n=s^2-1$, the base is of the form $p.q1$, raised to $\frac{n+1}{2}$ power
  • result is irrational otherwise