Calculates page numbers and cursors of paged results
It calculates the page number and cursor (first item number on the current page) vice versa.