Let P(N) be the prior distribution for the number N. Let P(p|N) be the conditional probability for p given N; we know that P(p|N) = 1/N. We wish to compute the conditional probability P(N|p), which can be expanded using Bayes theorem
So, if we are given a well-defined probability function P(N), we can easily compute the number N that gives that maximum probability P(N|p).
The problem is that we are not given what P(N) is. One reasonable choice would be to assume that P(N) is the improper uniform distribution from p to infinity (every number has an equal chance of occuring). However, if we plug that improper distribution into the equation above, we would be able to cancel out P(N), but we'd end up with a harmonic series in the denominator, which does not converge.