Extremely Complex Math Problem