These problems are about considering the worst case scenario.
How can I not get pairs?
The first four socks can be red, green, black, blue
They are also of the form ODD, ODD, ODD, ODD (1 of each)
The fifth sock has to form a pair. Let's assume we get a blue pair.
So now we have red, green, black, blue, blue,
and are of the form ODD, ODD, ODD, EVEN
How can I not get a pair on the 6th selection? I have to get a blue (there was an even number so adding one won't form a pair)
So now we have red, green, black, blue, blue, blue.
We are back to ODD, ODD, ODD, ODD
No matter what I get on the 7 selection it will form a pair and the form will be
ODD, ODD, ODD, EVEN
To maintain this "worst case scenario" the 8th selection must be of the same color as the 7th (be the even one).
The 9th must necessarily form another pair.
So (x,y) represent (pairs, selections).
(1,5) (2,7) (3,9)....(10,y)
We can great an equation y=2x+3. Substituting 10 for x we obtain 23.