Ask your own question, for FREE!
Mathematics 24 Online
OpenStudy (steve816):

Help me figure this out How do I find the number of times needed for these patterns of numbers to be added to a result. It's kinda like the process of figuring out binary. 1, 2, 4, 8, 16, 32 ,64, 128, 256... etc. For example, the number 17 would be 2 because 16 + 1 = 17, because 2 numbers are being added. The number 25 would be 3 because 16 + 8 + 1 = 25 because 3 numbers are being added.

OpenStudy (dustin_whitelock):

http://openstudy.com/updates/584d6affe4b071fda882243d

OpenStudy (holsteremission):

Sounds like you want a formula that gives the number of \(1\)s in the binary expansion for any given decimal integer. Let's say \(a_n\) denotes this number for any (non-negative) integer \(n\). Starting with \(n=0\), you have \(0_{10}=0_2\), so \(a_0=0\). Now assume \(n>0\), and consider the cases when \(n\) is even and when \(n\) is odd. If \(n\) has \(a_n\) \(1\)s in its binary expansion, then \(2n\) will also have \(a_n\) \(1\)s. Why? Consider for example \(n=3\) and \(n=6\). \[3_{10}=11_2=2^1+2^0\implies 6_{10}=2\times3_{10}=2^2+2^1=110_2\]Any time you double \(n\), you add a new digit to \(n\)'s binary expansion, but that new digit is \(0\). So \(a_{2n}=a_n\). The odd case can be treated similarly. Odd integers can be written in the form \(2n+1\). If \(2n\) has \(a_{2n}=a_n\) \(1\)s, then the expansion for \(2n+1\) is the same but adds \(1\) as the last digit. This means \(a_{2n+1}=a_{2n}+1=a_n+1\). So you have the recursive formula for the number of \(1\)s in a binary expansion: \[\begin{cases}a_0=0\\[1ex]a_{2n}=a_n\\[1ex]a_{2n+1}=a_n+1\end{cases}\]Let's verify that this works for the examples you provide. \[\begin{align*} n=17\implies a_{17}&=a_{2\times8+1}\\[1ex]&=a_8+1\\[1ex]&=1+1\\[1ex]&\stackrel{\color{red}\checkmark}{=}2\end{align*}\]\[\begin{align*} n=25\implies a_{25}&=a_{2\times12+1}\\[1ex] &=a_{12}+1\\[1ex] &=a_6+1\\[1ex] &=a_3+1\\[1ex]&=a_{2\times1+1}+1\\[1ex]&=a_1+2\\[1ex] &=1+2\\[1ex]&\stackrel{\color{red}\checkmark}=3\end{align*}\]

OpenStudy (steve816):

Thank you so much!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!