MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a natural number, What is the maximal natural number below it, whose sums of digits in base 10 and base 2 are the same? Is there a clever algorithm to do this aside from the brute force search? is the sequence of those numbers.

Related questions are: Does there always exist a natural number the sum of the digits in the binary and decimal representations of which both equal to a given natural number? Is the maximum of such numbers for the given digit sum finite?

We can see that, in the sequence of natural numbers the binary and decimal representations of which are equal, an even number $n$ appears if and only if the odd number $n+1$ does.

I have posted this question in and have not gotten any answer.

What if the upper bound of the number is given as 1000, instead of a general method, is there a trick to solve it quickly?

share|cite|improve this question
For reference:… – András Bátkai Mar 30 '13 at 20:17
When posting a problem like this, please compute the first few terms of the sequence and check with the OEIS, so that others don't have to. In this case you get – Barry Cipra Mar 30 '13 at 22:36
@Barry: The question is only remotely related to A037308. – Mark Sapir Mar 31 '13 at 3:20
@Mark, unless I'm mistaken, A037308 is precisely the sequence the OP is asking about. (I'm not suggesting it answers the OP's questions, just that it's a helpful starting point.) – Barry Cipra Mar 31 '13 at 23:10
I added a specific bound of 1000. Is there a short cut for this ad hoc example? – Hans Apr 1 '13 at 23:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.