I'm looking for a set of conditions and maybe a proof of said conditions for the thought proposed in the title. It seems to me that what was stated in the title always is true when N is not a perfect square and N < m, but I can find instances that work for perfect squares N, e.g. m = 12, N = 4.
If it's not clear what I'm asking, I'm looking for a general case of what's asked in this question.
Any help is appreciated! Thanks.
Edit: m and N are positive integers.