If sum exist then push that sum into perfect square vector
perfectPowers . append ( i ) NEW_LINE continue NEW_LINE j = i * i NEW_LINE while ( j > 0 and j < ( n + 1 ) ) : NEW_LINE isSum [ j ] = True NEW_LINE j *= i NEW_LINE