I am looking for the least instance of two and three consecutive positive integers whose digital sum in base 10 is the same as their digital sum in base 2. What is the length of the longest run of consecutive of integers with this property?
2026-03-27 15:16:40.1774624600
Integers whose digital sum in base 10 is the same as digital sum in base 2
67 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
The first such two consecutive positive integers are $20=10100_2$ and $21=10101_2$. Indeed, it is easy to verify that no integers strictly between $1$ and $20$ have the two digital sums equal.
As for the longest such run, let $d(x)$ be the base 10 digital sum of $x$ and $b(x)$ be the base 2 digital of $x$. Note that $d(x+1)=d(x)+1$ iff $x+1$ is not a multiple of $10$ and $b(x+1)=b(x)+1$ iff $x+1$ is not a multiple of $2$. Now suppose that $b(x)=d(x)$, $b(x+1)=d(x+1)$, $b(x+2)=d(x+2)$, $b(x+3)=d(x+3)$, and $b(x+4)=d(x+4)$. At least one of the numbers $x+1,x+2,x+3,x+4$ must be even but not a multiple of $10$. If that number is $y$, then we have $d(y)=d(y-1)+1=b(y-1)+1\neq b(y)$ which is a contradiction. This shows that the longest such run has length at most $4$.
A similar argument shows that if there is a run of $4$ such numbers $x,x+1,x+2,x+3$ then $x+2$ must be a multiple of $10$. Indeed, given any $y$ which is a multiple of $10$ such that $b(y)=d(y)$ and $b(y-1)=d(y-1)$, then $x=y-2$ will give such a run.
Probably there is a more systematic way you could find such a $y$, but I found one just by lazy trial and error: $$y=1225000005120=10001110100110111101100001010111000000000_2$$ has $b(y)=d(y)=18$ and $$y-1=1225000005119=10001110100110111101100001010110111111111_2$$ has $b(y-1)=d(y-1)=26$. So, the maximum length of such a run is indeed $4$.
(To demystify this example a little bit, note that $d(y-1)-d(y)$ will be $8$ if $y$ is a multiple of $10$ and not a multiple of $100$. So, for such a $y$, we need $b(y-1)-b(y)=8$, which means that $y$ should be a multiple of $2^9$ and not a multiple of $2^{10}$. Now, for most numbers $d(y)$ will be much larger than $b(y)$, so we want to keep $d(y)$ small in order to get $d(y)=b(y)$. So, I found the number above by just doing trial and error with numbers which are multiples of $2^9$ but not $2^{10}$ and have a lot of $0$s in base $10$.)