For a G.P. a,ar,ar2,…,arn−1 with r=1, the sum of the first n terms is Sn=r−1a(rn−1), equivalently written 1−ra(1−rn) when r<1; this is derived by multiplying Sn by r and subtracting the two series, so every middle term cancels and only a first and a last term survive. When r=1, every term equals a, so Sn=na. A related identity, Sn−Sn−1=tn, is useful for recovering the nth term when only a formula for Sn is given, and can also be used to prove that a sequence given by its Sn is a G.P. Repeating-digit sums such as 3+33+333+⋯ or 0.4+0.44+0.444+⋯ become genuine G.P. sums once factored and each block like 99…9 is rewritten as 10k−1.