# Trouble on writing the function for an account record pagination problem

I have this problem about account record pagination. I have to write the function that describes the total pages needed to contain those account records.

This is the problem:

# Account record quantity to store per page
per_page € R
# Account records to insert in pages
tot_acc € R

# The total pages needed to store the tot_account quantity
f(per_page,tot_acc) = tot_page € R = ?


I need to find f(per_page,tot_acc).

-
You'll need to explain what these quantities mean. – joriki Mar 12 '11 at 0:09
@joriki I updated the question. – user8136 Mar 12 '11 at 0:18

With all variables as integers, given the first page number of a set of accounts $i$, the number of accounts that can fit on a page $d$, the total number of accounts $n$, what is the number of the last page?
If so, then you need to use $\left\lceil \frac{n}{d}\right\rceil$ pages for the accounts where the brackets mean ceiling i.e. round up to the next integer. You need to add that to the page before the starting point $i-1$ to give the final page of the accounts $$f(i,d,n) = \left\lceil \frac{n}{d}\right\rceil + i -1$$ or if you prefer $$\text{tot_page} = f(\text{page, per_page, tot_acc}) = \left\lceil \frac{\text{tot_acc}}{\text{per_page}}\right\rceil + \text{page} -1.$$