in reply to Handling paged results

This sounds suspiciously like homework, so no code will be forthcoming...but it also sounds like you can describe the problem well enough to analyse it like a programmer, so writing your own should be easy.

Have a think about your inputs and outputs. (It might help the maths to treat your pages as "0|1|2", "3|4|5" etc., then simply add 1 before printing.)

...etc. Get these questions clear in your head, and you'll be pumping out code in no time.

Cheers, Ben.