Ten problems on arithmetic and geometric sequences and their sums: a sequence from two of its terms, the sum of the multiples of 7 between 100 and 500, the first sum past 1000, a geometric sequence with a negative ratio, the derivation of the geometric sum formula, a repeating decimal as a fraction, sums in sigma notation with shifted indices, the weights of an exponential moving average and its bias correction, the sum of k xᵏ and the mean of a geometric distribution, and the monthly payment on a loan, with worked solutions and the mistakes of counting terms as upper minus lower, summing a geometric series with |r| ≥ 1, putting the wrong digits over 999, bias-correcting with 1 − β instead of 1 − βᵗ, and rounding the number of terms down.
Before you start
An arithmetic sequence adds the same number at every step and a geometric sequence multiplies by the same number, and between them they describe straight-line growth, compound interest, repeating decimals, the decay of an exponential moving average and the first sums anyone meets in calculus. These ten problems find a sequence from two of its terms, add up long stretches of each kind, derive the geometric sum formula rather than quote it, and then use it where it matters: a repeating decimal, the bias correction in the Adam optimizer, the mean of a geometric distribution and the payment on a loan. The five mistakes at the end are the ones that give a confident wrong number: a sum in sigma notation with one term missing, a divergent series given a finite sum, the wrong digits over ,999, a bias correction with the wrong power, and a number of terms rounded the wrong way.
Arithmetic. With first term a1 and common difference ,d, the n-th term is ,an=a1+(n−1)d, and the sum of the first n terms is :Sn=2n(a1+an): the number of terms times the average of the first and last.
Geometric. With first term a1 and common ratio ,r,,an=a1rn−1, and for ,r=1,.Sn=1−ra1(1−rn). For ,r=1,.Sn=na1.
Infinite geometric series. For ,∣r∣<1,rn→0 and .Sn→1−ra1. For ∣r∣≥1 the terms do not shrink to 0 and the series diverges (with ).a1=0).
Counting. The n−1 in an counts steps, not terms: from a1 to an is n−1 steps. A sum ∑k=mM has M−m+1 terms.
Sigma notation.∑k=mMck means .cm+cm+1+⋯+cM. Substituting j=k−m shifts the index to start at 0 without changing the sum.
Problems
·
An arithmetic sequence has a5=23 and .a12=51. Find ,d,,a1, a formula for ,an, and .a40.
·
Find the sum of all the multiples of 7 between 100 and .500.
··
For the arithmetic sequence ,3,7,11,…, find Sn as a function of ,n, and the smallest n with .Sn>1000.
·
A geometric sequence has a3=12 and .a6=−96. Find ,r,a1 and .S8.
··
Derive the formula Sn=1−ra1(1−rn) for .r=1. Use it to find ,1+2+4+⋯+263, the grains of rice on a chessboard that doubles from one grain on the first square.
··
Write 2.145=2.1454545… as a fraction in lowest terms by summing a geometric series.
··
Evaluate both sums, and write the second with its index starting at :0:
k=4∑15(2k−5)andk=2∑73⋅2k
···
An exponential moving average starts at v0=0 and updates .vt=βvt−1+(1−β)gt. Show that vt=(1−β)∑k=1tβt−kgk and that the weights add up to .1−βt. With β=0.9 and every ,gk=g, find v10 and the bias-corrected .v^10=v10/(1−β10). How many steps until the weights add up to more than ?0.99?
···
Show that ∑k=1∞kxk=(1−x)2x for ∣x∣<1 by subtracting xT from .T. Then find ,∑k=1∞k/2k, and the mean number of trials ∑k=1∞kp(1−p)k−1 until the first success when each succeeds with probability .p=0.2.
···
A loan of 20000 dollars charges 0.5% interest per month and is repaid in 60 equal monthly payments, each made at the end of a month. Find the payment and the total interest.
Answers
,d=4,,a1=7,,an=4n+3,a40=163
17157
;Sn=n(2n+1)=2n2+n; the smallest n is 23
,r=−2,,a1=3,S8=−255
;Sn=1−ra1(1−rn); the board holds 264−1≈1.845×1019 grains
55118
,168, and ∑j=0512⋅2j=756
,v10≈0.651g,;v^10=g; the weights pass 0.99 at t=44
;∑kxk=(1−x)2x;;∑k/2k=2; the mean is 1/p=5 trials
Payment ≈386.66 dollars; total paid ,≈23199.36, so interest ≈3199.36 dollars
Worked solutions
Problem 1
An arithmetic sequence has a5=23 and .a12=51. Find ,d,,a1, a formula for ,an, and .a40.
,7d=51−23=28, so d=4From term 5 to term 12 is 12−5=7 steps.
a1=23−4⋅4=7Walk back four steps from .a5.
an=7+4(n−1)=4n+3The n-th term formula, simplified.
a40=4⋅40+3=163Check the formula: .a12=48+3=51.
,d=4,,a1=7,,an=4n+3,a40=163An arithmetic sequence is a straight line sampled at whole numbers: an=4n+3 has slope ,d=4, and any two terms fix the line.
Problem 2
Find the sum of all the multiples of 7 between 100 and .500.
First: ;7⋅15=105; last: 7⋅71=497100/7≈14.3 and ,500/7≈71.4, so the multiples run from 7⋅15 to .7⋅71.
n=71−15+1=57 termsOne term for each of .15,16,…,71.
S57=257(105+497)Arithmetic with :d=7: number of terms times the average of first and last.
=57⋅301.(105+497)/2=602/2=301.
17157This is Gauss's pairing: ,105+497,,112+490, and so on all equal .602. With an odd number of terms the middle one, ,301=7⋅43, pairs with itself, and the formula still holds.
Problem 3
For the arithmetic sequence ,3,7,11,…, find Sn as a function of ,n, and the smallest n with .Sn>1000.
,a1=3,,d=4,an=3+4(n−1)=4n−1The common difference is .7−3=4.
Sn=2n(3+4n−1)=n(2n+1)First plus last is ;4n+2; halve it.
2n2+n−1000=0 at n=4−1+8001The quadratic formula, positive root.
n≈22.11.8001≈89.45.
;S22=22⋅45=990;S23=23⋅47=1081Sn increases with ,n, so check the whole numbers on each side of the root.
;Sn=n(2n+1)=2n2+n; the smallest n is 23The sum of an arithmetic sequence is quadratic in ,n, as the area under a line is quadratic in its length. The root 22.11 must be rounded up: 22 terms are not enough (Mistake 5).
Problem 4
A geometric sequence has a3=12 and .a6=−96. Find ,r,a1 and .S8.
,r3=a3a6=−8, so r=−2Three steps of the ratio separate term 3 from term ;6; a cube root keeps the sign.
a1=(−2)212=3.a3=a1r2.
S8=1−(−2)3(1−(−2)8)The sum formula with .n=8.
=33(1−256)=−255,(−2)8=256, and .1−(−2)=3.
,r=−2,,a1=3,S8=−255Check by adding: .3−6+12−24+48−96+192−384=−255. With an even number of terms and ,r<−1, the last, negative term is the largest in size, so the sum is negative.
Problem 5
Derive the formula Sn=1−ra1(1−rn) for .r=1. Use it to find ,1+2+4+⋯+263, the grains of rice on a chessboard that doubles from one grain on the first square.
Sn=a1+a1r+⋯+a1rn−1The n terms, from r0 to .rn−1.
rSn=a1r+a1r2+⋯+a1rnMultiply every term by :r: the list shifts one place.
Sn−rSn=a1−a1rnEvery term but the first of Sn and the last of rSn cancels.
Sn=1−ra1(1−rn)Factor out Sn and divide by ,1−r, which is allowed because .r=1.
Chessboard: ,a1=1,,r=2,,n=64, so S64=1−21−264=264−164 squares hold 20 to .263.
;Sn=1−ra1(1−rn); the board holds 264−1≈1.845×1019 grainsThe same sum is the largest unsigned 64-bit integer, :18446744073709551615: in binary it is sixty-four 1s. For r>1 the form a1(rn−1)/(r−1) keeps both parts positive.
Problem 6
Write 2.145=2.1454545… as a fraction in lowest terms by summing a geometric series.
2.145=2.1+0.045+0.00045+…Split off the part that does not repeat; each repeat of 45 is two places further right.
The tail is geometric with a1=0.045 and r=0.01Each term is 1001 of the one before.
Tail =1−0.010.045=0.990.045,∣r∣<1, so the infinite sum is .a1/(1−r).
=99045=221Multiply top and bottom by ,1000, then cancel .45.
55118Check: .118/55=2.14545…. Every repeating decimal is a geometric series with ratio 10−p for a block of p digits, which is why every repeating decimal is a fraction.
Problem 7
Evaluate both sums, and write the second with its index starting at :0:
k=4∑15(2k−5)andk=2∑73⋅2k
First sum: 15−4+1=12 terms, from 2⋅4−5=3 to 2⋅15−5=25The terms go up by 2 each time: arithmetic with .d=2.
∑k=415(2k−5)=212(3+25)=168Number of terms times the average of first and last.
Second sum: j=k−2 runs from 0 to ,5, and 3⋅2k=3⋅2j+2=12⋅2jSubstituting k=j+2 moves the shift into the coefficient.
∑j=0512⋅2j=2−112(26−1)Geometric with ,a1=12,,r=2, and 6 terms.
=12⋅63=756Check: .12+24+48+96+192+384=756.
,168, and ∑j=0512⋅2j=756Before applying a formula, read off three things from the sigma: the first term, the ratio or difference, and the number of terms, upper minus lower plus one.
Problem 8
An exponential moving average starts at v0=0 and updates .vt=βvt−1+(1−β)gt. Show that vt=(1−β)∑k=1tβt−kgk and that the weights add up to .1−βt. With β=0.9 and every ,gk=g, find v10 and the bias-corrected .v^10=v10/(1−β10). How many steps until the weights add up to more than ?0.99?
,v1=(1−β)g1,,v2=(1−β)(βg1+g2), and so onUnroll the recursion from :v0=0: each step multiplies the old terms by β and adds a new one.
vt=(1−β)∑k=1tβt−kgkBy induction: βvt−1 raises every power by one, and (1−β)gt is the k=t term with .β0.
Weights: (1−β)(1+β+⋯+βt−1)The powers βt−k for ,k=t,t−1,…,1, a geometric sum of t terms.
=(1−β)⋅1−β1−βt=1−βtProblem 5's formula with a1=1 and .r=β.
v10=(1−0.910)g≈0.6513gWith a constant input, vt is the total weight times ;g;.0.910≈0.3487.
v^10=0.65130.6513g=gDividing by the total weight makes the weights add up to .1.
0.9t<0.01 when t>ln0.9ln0.01≈43.7Take logs; ln0.9<0 flips the inequality.
,v10≈0.651g,;v^10=g; the weights pass 0.99 at t=44Starting from 0 biases the average toward 0 by the factor ,1−βt, and Adam's bias correction divides it out. By t=44 the factor is 1−0.944≈0.9903 and the correction barely matters; with ,β=0.999, as for Adam's second moment, it takes about 4600 steps.
Problem 9
Show that ∑k=1∞kxk=(1−x)2x for ∣x∣<1 by subtracting xT from .T. Then find ,∑k=1∞k/2k, and the mean number of trials ∑k=1∞kp(1−p)k−1 until the first success when each succeeds with probability .p=0.2.
T=x+2x2+3x3+… and xT=x2+2x3+…Multiply by :x: each coefficient moves one power up.
T−xT=x+x2+x3+…Coefficients k and k−1 meet at each power ,xk, leaving .1.
=1−xxA geometric series with ,a1=x,r=x and .∣x∣<1.
T=(1−x)2xDivide by .1−x. The series converges for ,∣x∣<1, since the ratio of consecutive terms, ,kk+1∣x∣, tends to ;∣x∣<1; so T is a finite number and the subtraction is allowed.
Mean: 1−pp∑kk(1−p)k=1−pp⋅p21−p=p1Take one factor 1−p outside, then step 4 with ,x=1−p,.1−x=p.
;∑kxk=(1−x)2x;;∑k/2k=2; the mean is 1/p=5 trialsA sum whose terms are an arithmetic sequence times a geometric one is called arithmetico-geometric, and the subtraction that proves the geometric formula reduces it to a geometric sum. The same answer comes from differentiating ∑xk=1/(1−x) and multiplying by .x.
Problem 10
A loan of 20000 dollars charges 0.5% interest per month and is repaid in 60 equal monthly payments, each made at the end of a month. Find the payment and the total interest.
After n months the debt has grown to L(1+i)n with ,L=20000,i=0.005Each month multiplies the balance by .1+i.
Payment k has grown to P(1+i)60−k by month 60It is made at the end of month k and earns interest for the remaining months.
P∑j=059(1+i)j=P⋅i(1+i)60−1A geometric sum with ,a1=1,r=1+i and 60 terms.
L(1+i)60=P⋅i(1+i)60−1The loan is repaid when the payments, grown to month ,60, equal the grown debt.
P=1−(1+i)−60Li=1−1.005−60100Divide both sides by ;(1+i)60;.Li=100.
,1.00560≈1.34885, so 1−1.005−60≈0.25863One power, then its reciprocal.
Payment ≈386.66 dollars; total paid ,≈23199.36, so interest ≈3199.36 dollars.60×386.656≈23199.36. Simple interest on the full 20000 for five years would be ;6000; it is about half that because the balance falls as it is repaid.
Where this goes wrong
1. Counting the terms as upper minus lower
A sum ∑k=415 looks like it covers a stretch of length .15−4.
∑k=415(2k−5) runs from 3 to 25Right so far: Problem 7, step 1.
“There are 15−4=11 terms.”The subtraction counts the steps between k=4 and ,k=15, and there is one more term than there are steps.
S=211(3+25)=154The sum has 15−4+1=12 terms and equals .168. A quick check is to count a short case by hand: ∑k=45 has two terms, not one.
2. Summing a geometric series with |r| ≥ 1
The formula a1/(1−r) gives a number for any ,r=1, and nothing in the arithmetic stops at the condition.
∑k=0∞(23)k is geometric with a1=1 and r=23Right so far.
“The infinite sum is first term over .1−r.”That holds only when ,∣r∣<1, because the formula is the limit of a1(1−rn)/(1−r) and needs .rn→0.
∑k=0∞(23)k=1−3/21=−2A sum of positive terms cannot be negative. Here rn grows without bound, the partial sums 1,2.5,4.75,… do too, and the series diverges.
3. Putting the wrong digits over 999
The rule that a repeating block of p digits goes over p nines is remembered without the condition that the block starts right after the decimal point.
2.145=2.1454545…Right so far: Problem 6.
“The digits after the point are ,145, three of them, so the fraction is .145/999.”Only 45 repeats; the 1 is written once. Putting it inside the block repeats it too.
2.145=2+999145That is ,2.145145…, not .2.14545…. Split off the part that does not repeat first: .2.1+99045=55118.
4. Bias correction with 1 − β instead of 1 − βᵗ
The update has a 1−β in it, and dividing by the same factor looks like the way to undo it.
v10=(1−0.910)g≈0.6513gRight so far: Problem 8, step 5.
“The average is scaled by ,1−β, so divide by .1−β.”The 1−β in the update is already balanced by the sum of the powers of ;β; what is missing is the weight on the steps before ,t=1, which is .βt.
v^10=1−0.9v10≈6.51gThat is more than six times the true average. The total weight is 1−βt (Problem 8, step 4), and dividing by it gives .v^10=g. With 1−β the estimate tends to 10g instead of g as t grows.
5. Rounding the number of terms down
The quadratic formula gives a decimal, and rounding to the nearest whole number is the usual reflex.
2n2+n=1000 at n≈22.11Right so far: Problem 3, step 4.
“Round 22.11 to .22.”The question asks for ,Sn>1000, and Sn increases, so n must be at least the root.
n=22,S22=990, still short of .1000. The smallest n is ,23, with .S23=1081. When the answer must exceed a threshold, round up and check both neighbors.