Professor Nitwit obtains a hash number of a given positive integer greater…

TCS · 2024

Professor Nitwit obtains a hash number of a given positive integer greater than 3 as follows. He subtracts 2 from the number (to get the new number), and multiplies the new number by 2 to get a term. He repeats this with the new number (to get newer numbers and terms) until the number becomes 2 or 1. The hash is defined as the sum of all the numbers generated in the process.

For example, with the number 5, he multiplies (5 - 2 = 3) by 2 to get the first term 6. He multiplies (3 - 2 = 1) by 2 to get the second term 2. As the number has become 1, he stops. The hash is the sum of the two numbers (6 + 2) = 8.

If Professor Nitwit is given 3 numbers 4, 9 and 13, what is the sum of the hash numbers he obtains for the three numbers?

  1. A.

    250

  2. B.

    150

  3. C.

    200

  4. D.

    108

Attempted by 57 students.

Sign up free to check your answer

Sign up free

Explore the full course: Tcs Ignite Smart Hiring

Loading lesson…