<s>[INST] Why the remainders of the division of a number by 2 results in the number in binary? For example 14, if you divide be 2 it equals 7 and the remainder = 0, then 7/2 = 3 with r = 1 then 3/2 = 1 and r = 1 then 1/2 = 0 with r = 1. If we take the r's and put them togheter 1110 is 14 in binary. I don't understand the intuition behind this, why does this work?
 [/INST] This is because of Horner's scheme for evaluating polynomials:
\begin{align}&a_nx^n+a_{n-1}x^{n-1}+a_{n-2}x^{n-2}\dots+a_1x+a_0\\
={}(\dots(((&a_nx+a_{n-1})x+a_{n-2})x+\dots+a_1)x+a_0.
\end{align}
The successive divisions by $2$ yield
\begin{align}
14&=7\cdot 2+0\\&=(3\cdot2+1)\cdot 2+0=3\cdot2^2+1\cdot 2+0\\
&=\color{red}{((1\cdot2+1)\cdot2+1)\cdot 2+0}=(1\cdot2+1)\cdot2^2+1\cdot 2+0 \\ &=1\cdot2^3+1\cdot2^2+1\cdot 2+0
\end{align}
</s>