Question: ( The binary number system. ) Take any nonnegative integer n , and let bkbk 1 . . . b 2 b 1 b 0

(The binary number system.) Take any nonnegative integer n, and let bkbk1... b2b1b0 be the
binary digits of n.
(a) Show that (bkbk1... b2b1b00)bin is equal to 2n.(In other words, sticking a 0 on the end
of a binary string multiplies the result by 2.)
1
(b) Show that (bkbk1... b2b1)bin is equal to
n
2
.(In other words, removing the last digit
from a binary string is the same as dividing the result by 2 and rounding down.)
(c) In computer science, we call the binary operation described in (a) a left shift by one bit.
Similarly, we call the binary operation in (b) a right shift by one bit.
Suppose that n is a number with the following property: when written in binary, if n is
first shifted right and then shifted left, the result is a prime number. What could n have
been originally, and why?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!