I recently came along a question regarding a series where it was required to write a general formula to calculate the sum when the number of terms is given. The series was as follows - 1+11+111+1111... and so on.
I immediately noticed that the sum of 1+11+111+1111... could be expressed as an AGP [$10^{n-1}$+2($10^{n-2}$)+3($10^{n-3}$)+...n] with the first term being $10^{(n-1)}$, the common difference as 1 and the common ratio as 0.1 with n denoting the number of terms.
Inputting these values into the formula for the sum of an AGP uptil n terms, I got - $$\frac{10^n}{9} + \frac{10^n - 10^{2-n}}{81} - \frac{[1+(n-1)10^{1-n}]}{9}$$ as the resultant formula.
Formula used as reference to calculate the sum of an AGP - $$\frac{a}{1-r} + \frac{dr(1-r^{n-1})}{(1-r)^2}-\frac{[a+(n-1)d]r^n}{1-r}$$ where a denotes the initial term of the AGP, r denotes the common ratio, and d denotes the common difference.
However, this formula only works for n=1, and for all succeeding integral values of n, there always exists some kind of error. For example, at n=2, the formula outputs the value of 11.1, at n=3, it outputs 111.12.
I've gone through the formula multiple times, and am unable to point out the error. Hence, I would be highly obliged if any of you could tell me whether I have committed a mistake, or if this is a problem with the formula of a sum of AGP uptil n terms.
Thanks, a math nerd.
P.S. I apologize for any and all formatting mistakes, as I am very new to this MathJax stuff.
Note - I have managed to figure out my blunder (I had taken a to be equal to $10^{n-1}$ and so the resultant series wasn't an AGP) and so this question no longer requires an answer. Thanks to any & all who took out their precious time to look at the problem.