Just differentiate the arithmetic mean and find the turning point(s) of the curve. If you have a local maximum, followed by a local minimum, followed by a local maximum then the hollow curve phenomenon has struck again.
Hmm . . . I think you will need to look at the second differential. (My memory of A-level pure mathematics, from 50+ years ago, has faded somewhat.)