1
$\begingroup$

My birthday is 10th of October or 1010 in MMDD format.

I just realized that 1010 contains two copies of the number 10 and if spelled out in binary,

$1010_2=10$

I was wondering how many other numbers have this property

In general we can use the following formula

$N=\sum_{j=0}^n a_j*2^j$ + $\sum_{j=n+1}^{2n+1}a_{j-n-1}*2^j$

$N=\sum_{k=0}^n a_k*10^k$

(In both equations all the $a_i$ are either $0$ or $1$, n is one less than the number of digits in the repeated digit sequence, so for $1010_2$, $n=1$, $a_0=0$, $a_1=1$)

Subtracting the second from the first and factoring coefficients,

$0=\sum_{d=0}^n a_d*(2^{d}+2^{n+d+1}-10^d)$

$0=\sum_{d=0}^n a_d*2^d*(2^{n+1}+1-5^d)$

I am not sure how to solve from here on out

Also would like to know if there are any other solutions besides 0 and 1 in other bases.

$\endgroup$
  • $\begingroup$ A small comment on notation: you set this up to equate an $(n+1)$-digit decimal numeral with a $(2n+2)$-digit binary numeral. It might be simpler to compare an $n$-digit number with a $2n$-digit number. $\endgroup$ – David K Mar 23 at 20:09
  • 1
    $\begingroup$ Requiring a leading $0$ in binary & base $10$ expansions results in relatively few values to check (& I believe the answer is there are no more, but I haven't confirmed) as shown by the answers below. However, you did not explicitly state this is required. Thus, for example, if you allow the use of leading zeros, a valid value to check on could have a base $2$ expansion of $000101000101_2$. This more general case is, I believe, quite interesting. There'll be few values which fit your criteria, but I suspect there may still be infinitely many. If you're interested in this, please specify it. $\endgroup$ – John Omielan Mar 24 at 1:26
  • $\begingroup$ Yes, that is interesting, though I had not considered it initially $\endgroup$ – aman Mar 24 at 3:00
3
$\begingroup$

The number of digits in the decimal expression of a number is $\lfloor \log_{10} N \rfloor + 1$, and the number of bits in its binary expansion is $\lfloor \log_2 N \rfloor + 1$, so any number $N$ with the given reduplication property must satisfy $$\lfloor \log_2 N \rfloor + 1 = 2 (\lfloor \log_{10} N \rfloor + 1) .$$ Using twice that $\log_b N \geq \lfloor \log_b N \rfloor > \log_b N - 1$ gives $$\log_2 N < 2 \log_{10} N + 2 = \frac{2}{\log_2 10} \log_2 N + 2.$$ Rearranging gives $$\log_2 N \leq \frac{2 \log_2 10}{\log_2 10 - 2} < 6,$$ so $N < 2^6 ,$ but this leaves only $0, 1, 10, 11$ to check.

$\endgroup$
  • 1
    $\begingroup$ Very nice. Sometimes it's better to work with easier necessary conditions than the exact statement. $\endgroup$ – amsmath Mar 23 at 20:13
  • 1
    $\begingroup$ Another way to look at it: setting $n$ as in the original question, the decimal number is at least $10^n,$ and the binary number is less than $4\cdot4^n,$ so you can have a solution only if $10^n<4\cdot4^n,$ or $2.5^n<4.$ Since $2.5^2 = 6.25,$ we must have $n<2,$ so the decimal number can have only $1+1 =2$ digits at most. Basically the same logic but with exponents instead of logarithms. $\endgroup$ – David K Mar 23 at 20:16
  • $\begingroup$ Nicely put, David. $\endgroup$ – Travis Willse Mar 23 at 20:30
  • $\begingroup$ Thanks for the answer. However, N should be used rather than n, that confused me initially $\endgroup$ – aman Mar 24 at 3:04
  • $\begingroup$ You're welcome. I've changed the notation to match that in the question. $\endgroup$ – Travis Willse Mar 24 at 3:28
1
$\begingroup$

This is only a partial answer. For $n>1$ there is always a smallest number $d_0\le n$ such that $2^{n+1}+1-5^{d_0} < 0$. So, your equation becomes $$ \sum_{d=0}^{d_0-1}a_d\cdot 2^d(2^{n+1}+1-5^d) = \sum_{d=d_0}^na_d\cdot 2^d(5^d-(2^{n+1}+1)). $$ Assume that one of $a_{d_0+1},\ldots,a_n$ is non-zero. Then the RHS is at least as large as $2^{d_0+1}(5^{d_0+1}-(2^{n+1}+1))$, which by definition of $d_0$ is larger than $2^{d_0+1}(5(2^{n+1}+1)-(2^{n+1}+1)) = 2^{d_0+3}(2^{n+1}+1)$. The LHS can be estimated by \begin{align*} LHS &\le \sum_{d=0}^{d_0-1}2^d(2^{n+1}+1-5^d) = (2^{n+1}+1)(2^{d_0}-1) - \frac{10^{d_0}-1}{9}\\ &\le (2^{n+1}+1)(2^{d_0}-1) - \frac{(2^{n+1}+1)}{9}2^{d_0} + \frac 19\\ &= (2^{n+1}+1)\left(\frac 89\,2^{d_0}-1\right) + \frac 19 < (2^{n+1}+1)\left(2^{d_0}-1\right) + \frac 19\\ &< (2^{n+1}+1)2^{d_0+3} < RHS. \end{align*} Hence, we conclude that $a_{d_0+1}=\cdots=a_n = 0$. This reduces your equation to $$ \sum_{d=0}^{d_0-1}a_d\cdot 2^d(2^{n+1}+1-5^d) = 2^{d_0}(5^{d_0}-(2^{n+1}+1)). $$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.