The problem is that the addition has to be done in a similar way to the division. So, it should be:
Code:
program: divide(field("size"),add(field("#pages"),1));
But, that actually gives zero for everything as the "size" column is always zero. You need to use the booksize function:
Code:
program: divide(booksize(),add(field("#pages"),1));
"booksize()" is the size in bytes for one of the formats for the book. It looks like it is the size of the largest format.