Answer:
You have to take 15 pens to get at least one red pencil.
Explanation:
If there were one red and 6 green pens, there would be more red than green pens.
If there were 3 or more blue and thus 18 or more green pens, the number of pens would be over 20.
So there must be 2 blue, 12 green and thus 6 red pencils. So you have to take at least 15 pens to be sure that you got a red one.