I don't know how helpful the following is but your number N=152851016917 is a (6k+1) type of number. So the squares in N + n^2 = m^2 must be of the following form: n=3k and m=10+3j. Then your number becomes N + 9k^2 = (10+3j)^2. You obviously don't need to start with m=10. You get the starting point from the sqrt(N). That is if your number is 217=7*31, your starting point is m=10+3=13 because 13^2 is the first square of the correct from below 217. This will allow you to discard a lot of squares that do not have the right form. The other simple trick is the fact that N and m^2 must have have the same sum of digits. In the case of N=217, you can jump straight to m^2=19^2 since 13^2 and 16^2 do not have the same sum of digits. Good luck to you.
