Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

f : N -> N is a function that satisfies this set of relationships:

f(1) = 1, and:

f(2*n) = f(n), and:

f(2*n + 1) = f(2*n) + 1

Determine the maximum of f(n) whenever 1<= n <= 1994.

Edited by K Sengupta
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

a maximum of f(n) in this interval is 10

first ocurence is this value is for n=1023 f(1023) = 10

the same value will be also for some other n's. Actually value f(n) could be also defined as number of ones in binary form of n.

Edited by Hugo
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...