recategorized by
1,806 views
12 votes
12 votes

Let $N$ be the sum of all numbers from $1$ to $1023$ except the five primes numbers: $2, 3, 11, 17, 31.$ Suppose all numbers are represented using two bytes (sixteen bits). What is the value of the least significant byte (the least significant eight bits) of $N$?

  1. $00000000$
  2. $10101110$
  3. $01000000$
  4. $10000000$
  5. $11000000$
recategorized by

3 Answers

Best answer
13 votes
13 votes

This is another way of saying , what will be the remainder when $N$ is divided by $\large 2{^8}=256$ ?

Here $N =1023\times \dfrac{1024}{2} - (2+3+11+17+31)$

       $= 1023\times 512 - 64$

      $= 1022\times 512 + (512-64)$

      $= 1022\times 512 + 448$

Now $448 \% 256 = 192 = 11000000$

So option e) is correct.

edited by
3 votes
3 votes
$N= \frac{1023(1023+1)}{2} – (2+3+11+17+31) = 1023 \times 512 – 64 = (2^{10} – 1)2^9 – 2^6$

$ N= 2^6((2^{10} – 1)2^3 – 1)$

$\text{$2^{10}$ – 1 has binary representation 0000000001111111111 (10 times 1s)}$

$\text{$(2^{10} – 1)2^3$ has binary representation 0000001111111111000}$

$\text{(shifted $3$ bits left because $2^3$ is multiplied)}$

$\text{$(2^{10} – 1)2^3 – 1$ has binary representation 0000001111111110111}$

$\text{$2^6((2^{10} – 1)2^3 – 1)$ has binary representation 1111111110111000000}$

$\text{(shifted $6$ bits left because $2^6$ is multiplied)}$

$\text{$N = 523712 = 1111111110111000000$}$

$\textbf{Answer: (E)}$
0 votes
0 votes

total sum= 1+2+3+…….+1023 = 523776

now = 523776- (2+3+11+17+31) = 523712

hence converting N to decimals till the last 8 least significant bits= 11000000. Hence option E is the answer 

Answer:

Related questions

23 votes
23 votes
5 answers
2