Simulated below is the single-wide case, where there is only one block at every given level (no counter-balancing). The maximum amount of overhang, in terms of book lengths, is given by half of the ${n}^{\mathrm{th}}$ partial sum of the Harmonic series.

So, for a stack of n books, the largest possible distance from the edge of the table to the leading edge of the ${n}^{\mathrm{th}}$ book is:

${d}_{n}equals;\frac{1}{2}\cdot {H}_{n}equals;\frac{1}{2}\cdot \sum _{kequals;1}^{n}\frac{1}{k}$

Why?

Let ${d}_{n}$ be the maximum overhang for a stack of n identical books.

The key to obtaining the largest overhang is to have the center of gravity of n books lie directly above the table's edge, while the center of gravity of the top $n-1$ books lies directly over the leading edge of the bottom book.

By assigning M to be the mass of a single book, we can compute the total moment of n books with respect to the leading edge (the right edge in this simulation):

$n\cdot M\cdot {d}_{n}equals;M\cdot \left({d}_{n-1}plus;\frac{1}{2}\right)plus;\left(n-1\right)\cdot M\cdot {d}_{n-1}$

Solving for ${d}_{n}$ , we obtain the following recurrence relation:

${d}_{n}equals;{d}_{n-1}plus;\frac{1}{2\cdot n}$

It is obvious that ${d}_{1}equals;\frac{1}{2}$. Since the center of gravity of a single book lies at the center of its length, the optimal way to balance it would be to have one half rest on the table, while the other half hangs over the edge.

Now, we can see that:

${d}_{2}equals;{d}_{1}plus;\frac{1}{2\cdot 2}equals;\frac{1}{2}plus;\frac{1}{4}equals;\frac{1}{2}\cdot \left(1plus;\frac{1}{2}\right)$

${d}_{3}equals;{d}_{2}plus;\frac{1}{2\cdot 3}equals;\frac{1}{2}plus;\frac{1}{4}plus;\frac{1}{6}equals;\frac{1}{2}\cdot \left(1plus;\frac{1}{2}plus;\frac{1}{3}\right)$

${d}_{4}equals;{d}_{3}plus;\frac{1}{2\cdot 4}equals;\frac{1}{2}plus;\frac{1}{4}plus;\frac{1}{6}plus;\frac{1}{8}equals;\frac{1}{2}\cdot \left(1plus;\frac{1}{2}plus;\frac{1}{3}plus;\frac{1}{4}\right)$

and so on...

The general formula for this relation can be written as:

${d}_{n}equals;\frac{1}{2}\cdot \left(1plus;\frac{1}{2}plus;\frac{1}{3}plus;\frac{1}{4}plus;..period;plus;\frac{1}{n}\right)$

Recognizing the sum $1\+\frac{1}{2}\+\frac{1}{3}\+\frac{1}{4}\+..\.\+\frac{1}{n}$ as the Harmonic series, we can simplify this formula:

${d}_{n}equals;\frac{1}{2}\cdot {H}_{n}$ , where ${H}_{n}$ is the ${n}^{\mathrm{th}}$ Harmonic number

Since the Harmonic series diverges as $n\to \infty$, the maximum amount of overhang will become arbitrarily large as the number of books grows.