John has exactly 31 pens, and each pen is either bule, black, or red. If he has 5 more black pens than red pens, and twice as many blue pens as black pens, how many blue pens does john has ?
Choose the correct choice:
A) 15 B) 18 C) 20 D) 22 E) 17
x = the number of blue pens   y = the number of black pens   z = the number of red pens   From the first sentence we have   Equation #1: x + y + z = 31   ...he has 5 more black pens than red pens...   Equation #2: y = 5 + z   ...twice as many blue pens as black pens...   Equation #3: x = 2y   Solve equation #1 for z: z = y - 5   Now, we can replace both x and z with y in Equation #1   2y + y + (y - 5) = 31   4y - 5 = 31   4y = 36   y = 9   There are 9 black pens. This is 5 more than the number of red pens, so z = 4. Hence the answer is. x = 18, and just for check   18 + 9 + 4= 
<gadget id="calculator">  18 + 9 + 4</gadget>
<output>31</output>
31.   Answer= 18,(18)
<result>B</result>
John has exactly 31 pens, and each pen is either bule, black, or red. If he has 5 more black pens than red pens, and twice as many blue pens as black pens, how many blue pens does john has ?