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$?
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.
@Gupta731
Just try for random number and take "mod 256" , this remainder will always be represented by these 8 LSB's.
Now, 1023*1024/2 = 523776
now, 523776 - (2+3+11+17+31) = 523712
523712 mod 256 = 192
192 in binary => 11000000
total sum= 1+2+3+…….+1023 = 523776
now N = 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
64.3k questions
77.9k answers
244k comments
80.0k users