I remember people talking about this 10 years ago... "Surely we wouldn't have an iPhone 15, would we? It sounds so odd." Here we are 10 years later, and it doesn't sound so odd after all. While "iPhone 27" may sound odd now, I suspect it won't sound so odd by the time it rolls around.
That being said, I think they should eventually drop the number and just call it "iPhone" or "iPad". If you want to refer to a specific model, then use the year...like how they do with their Macs. There'll likely be a point where the iterative updates are so small, I don't think it would make sense to keep differentiating them by number. Though, I suppose that could be a marketing tactic to get people to keep upgrading... "Omg, the iPhone 31 is out? My iPhone 29 is so old!"
Or at least sync the number with the year, like Samsung does now. So next year's iPhone would be "iPhone 24". Then there would be some sort of meaning behind the number.