Function problems

Algebra Level 3

A function f f satisfies f ( 0 ) = 0 , f ( 2 n ) = f ( n ) f(0) = 0, f(2n) = f(n) , and f ( 2 n + 1 ) = f ( n ) + 1 f(2n + 1) = f(n) + 1 for all positive integers n n .

What is value of f ( 2017 ) f(2017) ?


The answer is 7.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Brian Moehring
Feb 12, 2017

Write 2017 2017 in binary as 1111110000 1 2 11111100001_2 . Then by the definition of f f , we have f ( 2017 ) = f ( 1111110000 1 2 ) = f ( 111111000 0 2 ) + 1 = f ( 11111100 0 2 ) + 1 = = f ( 11111 1 2 ) + 1 = f ( 1111 1 2 ) + 1 + 1 = = 1 + 1 + 1 + 1 + 1 + 1 + 1 = 7. f(2017) = f(11111100001_2) = f(1111110000_2) + 1 = f(111111000_2) + 1 = \cdots = f(111111_2) + 1 = f(11111_2) + 1 + 1 = \cdots = 1+1+1+1+1+1+1 = 7.

This doesn't merely compute the answer. It also tells us what f f actually is. In short, f ( n ) = digit sum of n in binary f(n) = \text{digit sum of } n \text{ in binary}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...