The solution to this entirely depends on whether you are willing to answer other questions about the number and of what nature. Would you answer: is it higher/lower than X? How about how many digits there are?
But assuming you are unwilling to answer any additional questions, the correct solution is to simply brute force every number up from 0 and its negative.
But assuming you are unwilling to answer any additional questions, the correct solution is to simply brute force every number up from 0 and its negative.