since every program can be reduced to a mathematical equation then yes there is a mathematical equation but thanks to the advent of high level programming languages we programmers need not worry about that.
It you are using a mysql database then just use the LIMIT command in sql and calculate your start value like this
($page-1) * $numPosts