Update yCount for current x . Keep reducing yCount while the inequality is not satisfied .
while ( $ yCount != 0 and ( $ x * $ x + ( $ yCount - 1 ) * ( $ yCount - 1 ) >= $ n ) ) $ yCount -- ; } return $ res ; }