Let certain number = x
Let original price of 1 pen = R5/x = 500cents/x
hence new price of 1 pen = 500/x - 5 , in (cents).
New number of pens = x+5.
Therefore new price of 1 pen x new number of pens = R5 = 500cents
(500/x - 5)(x+5) = 500
500+ 2500/x - 5x - 25 = 500
2500-5x^2 - 25x = 0
5x^2 + 25x -2500 = 0
x^2 + 5x - 500= 0
(x-20)(x+25) = 0
x = 20 or x = -25 , but x should be positive,
Therefore original number of pens,x, is 20.