ln is the logarithmus with the base of e (euler number, which is the value of the exponential function on the place 1, that means exp(1)). But u can use every random number for ur base. So log is just a general term, and ln is the special case, where the base has the value exp(1)
It can be transformed in many ways.
S/A = 1/q + 1/q^2 +... + 1/q^n
Or
Sq^(n+1) - (S+A)q^n + A = 0
here#1n = ln (A/(A-S*(q-1))) / ln(q) and here #2