With the following code I produce the binary digits of n=13:
n=13;
Q = Quotient[n, 2];
While[Q != 0, Print[Mod[n, 2]]; Q = Quotient[n, 2]; n = Q]
The problem is that it outputs the digits as
1
0
1
1
but I want them to appear horizontally 1101
. What is the most direct way to produce the desired effect regarding the output's style?
IntegerString[13, 2]
? $\endgroup$