Mmm, so much which could have been answered by simply typing a few words into google.

> then maybe it would work with larger numbers.
Of course it would "work", if your algorithm is correct....