Worked solution Checked against the mark scheme
Let x = green pens, so there are x+3 blue and 2x+3 in total.
(2x+3)(2x+2)x(x−1)+(x+3)(x+2)=5527
55(2x2+4x+6)=27(4x2+10x+6)
2x2−50x+168=0, i.e. x2−25x+84=0
(x−21)(x−4)=0, so x=21 or x=4
There are more than 12 pens, so x=4 (11 pens) is rejected: 21 green pens.
Watch out: Treating the picks as with replacement, or forgetting to add the two-blue case.