document.write( "Question 1161247: How many nonnegative integers n have the property that the digits of their base 2 representation are (in the same order) exactly the same as the digits of the base 3 representation of 2n? \n" ); document.write( "
Algebra.Com's Answer #784768 by greenestamps(13216)\"\" \"About 
You can put this solution on YOUR website!


\n" ); document.write( "The fastest way to answer this question is to list them out. The numbers have to be very small; the smallest 4-digit number in base 3 is 27; the largest 4-digit number in base 2 is 15.
\r\n" );
document.write( "   n   n (base 2)  2n  2n (base 3)\r\n" );
document.write( "  ---------------------------------\r\n" );
document.write( "   1         1      2        2\r\n" );
document.write( "   2        10      4       11\r\n" );
document.write( "   3        11      6       20\r\n" );
document.write( "   4       100      8       22\r\n" );
document.write( "   5       101     10      101\r\n" );
document.write( "   6       110     12      110\r\n" );
document.write( "   7       111     14      112\r\n" );
document.write( "   8      1000     16      121\r\n" );
document.write( "  ...

\n" ); document.write( "So the only two positive integers n for which n in base 2 has the same digits as 2n in base 3 are 5 and 6.

\n" ); document.write( "----------------------------------------------------------------

\n" ); document.write( "However, there is an opportunity for some good mathematics in solving the problem formally.

\n" ); document.write( "We know that the leading digit is always 1, and that all the digits are either 0 or 1

\n" ); document.write( "(1) If the representation is a single digit, then it is the digit 1; in both base 2 and base 3 that represents the number 1; and that does not satisfy the requirement that the number represents n in base 2 and 2n in base 3.

\n" ); document.write( "(2) If the representation is two digits, then it is 1a, where a is either 0 or 1.

\n" ); document.write( "1a in base 2 is 2+a; 1a in base 3 is 3+a.

\n" ); document.write( "To satisfy the requirement that the number represents n in base 2 and 2n in base 3, we would need to have
\n" ); document.write( "\"2%282%2Ba%29+=+3%2Ba\"
\n" ); document.write( "\"4%2B2a+=+3%2Ba\"
\n" ); document.write( "\"a+=+-1\"

\n" ); document.write( "So there are no 2-digit numbers that represent n in base 2 and 2n in base 3.

\n" ); document.write( "(3) If the representation is three digits, then it is 1ab, where both a and b are either 0 or 1.

\n" ); document.write( "1ab in base 2 is 4+2a+b; 1ab in base 3 is 9+3a+b.

\n" ); document.write( "To satisfy the requirement that the number represents n in base 2 and 2n in base 3, we would need to have
\n" ); document.write( "\"2%284%2B2a%2Bb%29+=+9%2B3a%2Bb\"
\n" ); document.write( "\"8%2B4a%2B2b+=+9%2B3a%2Bb\"
\n" ); document.write( "\"a%2Bb+=+1\"

\n" ); document.write( "That is satisfied by ab=01 or by ab = 10. That gives us the two solutions we found earlier: 101 and 110.

\n" ); document.write( "101 base 2 = 5; 101 base 3 = 10 = 2(5)
\n" ); document.write( "110 base 2 = 6; 110 base 3 = 12 = 2(6)

\n" ); document.write( "(4) If the representation were four digits, then it would be 1abc, where a, b, and c are all either 0 or 1.

\n" ); document.write( "1abc in base 2 is 8+4a+2b+c; 1ab in base 3 is 27+9a+3b+c.

\n" ); document.write( "To satisfy the requirement that the number represents n in base 2 and 2n in base 3, we would need to have
\n" ); document.write( "\"2%288%2B4a%2B2b%2Bc%29+=+27%2B9a%2B3b%2Bc\"
\n" ); document.write( "\"16%2B8a%2B4b%2B2c+=+27%2B9a%2B3b%2Bc\"
\n" ); document.write( "\"b%2Bc+=+11%2Ba\"

\n" ); document.write( "Clearly that can not be satisfied by three integers a, b, and c which are all either 0 or 1.

\n" ); document.write( "So there are no numbers of four (or more) digits that represent the number n in base 2 and the number 2n in base 3.
\r
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );