Any number can be expressed as the sum of squares of four numbers according to lagrange four square theorem, i want to find all possible solution for the given number, I know a algorithm which work in O(n*root(n)), is their any more optimized algorithm ?
thanks in advance :)