Let's prove it.

In general, sum(x^k, k=1…n) = x(1-x^n)/(1-x).

Then sum(kx^(k-1), k=1…n) = d/dx sum(x^k, k=1…n) = d/dx (x(1-x^n))/(1-x) = (nx^(n+1) - (n+1)x^n + 1)/(1-x)^2

With x=b, n=b-1, the numerator as defined in TFA is n = sum(kb^(k-1), k=1…b-1) = ((b-2)b^b + 1)/(1-b)^2 = ((b-2)b^b + 1)/(1-b)^2.

And the denominator is:

d = sum((b-k)b^(k-1), k=1..b-1) = sum(b^k, k=1..b-1) - sum(kb^(k-1), k=1..b-1) = (b-b^b)/(1-b) - n = (b^b - b^2 + b - 1)/(1-b)^2.

Then, n-(b-1) = (b^(b+1) - 2b^b - b^3 + 3b^2 - 3b +2)/(1-b)^2.

And d(b-2) = the same thing.

So n = d(b-2) + b - 1, whence n/d = b-2 + (b-1)/d.

We also see that the dominant term in d will be b^b/(1-b)^2 which grows like b^(b-2), which is why the fractional part of n/d is 1 over that.

I disagree with the author that a script works as well as a proof. Scripts are neither constructive nor exhaustive.

The author does not say a script works as well as a proof.

If you want to be lazier, after finding the generating functions one can plug into sympy to skip the algebra.