Mathematicians prove the best way to get tangles out of hair is to start brushing at the ENDS