For example, if we have a number like 29873412895, is there an algorithm that can find it as a difference of two squares? Or must you need the factors of the numbers? And what might be the algorithm? Thanks!
Apologies for my previous post, in which I acted very callous.
You don't need to factorise anything. Every positive integer can be expressed as one of the following:
The first and third are differences of two squares:
Numbers of the second form can't be expressed as the difference of two squares (because every square is equal to $0$ or $1$ mod $4$, so we can't subtract one from another to get $2$ mod $4$).