I was wondering if there is mathematical formula or a way to get the nth binary number where n is given. Obviously, this is a very easy problem for a programmer and I can construct a program (using loops) to find it but am interested in a mathematical way to obtain it.
To give an example if we assume 0 is the 0th binary number, and 1 is the first, I would like to get 1001 when I ask about the 9th number. Another way to put this is, does a fast way exist to convert decimal numbers into binary.
What about the general case? Does a formula exist that can quickly convert a number from a numerical system in base x to one in base y?
Thank you in advance!