wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let f be a function on non negative integers defined as follows
f(2n)=f(f(n))
f(2n+1)=f(2n)+1:
-If f(0)=0, find f(n) for every n.

Open in App
Solution

f(0)=0
f(2×0+1)=f(2×0)+1
f(1)=f(0)+1f(1)=1
Now, f(2×1)=f(f(12))f(2)=f(1)=1
f(2×1+1)=f(2×1)+1
f(3)=f(2)+1f(3)=1+1f(3)=2
f(2×2)=f(f(2))=f(1)=1
f(2×21)=f(4)+1
=1+1=2
f(5)=2
f(1)=f(2)=f(4)=.......=1
f(3)=f(5)=f(7)=......=2

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Functions
QUANTITATIVE APTITUDE
Watch in App
Join BYJU'S Learning Program
CrossIcon