Let x be the number of pencils bought at y cents each. Then 17-x must be the number of pencils bought at y+1 cents each. In that case
xy+(17-x)(y+1)=72
xy+17y-xy+17-x=72
17y=55+x
y=3+(4+x)/17
The only value for x less than 17 that makes y an integer is x=13, whereupon y=4.
The man bought thirteen plain pencils at four cents each and four pencils at five cents each.