of 30/30
Lesson 6: Sequences Adithya B., Brian L., William W., Daniel X. June 2020 Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 1 / 30

Lesson 6: Sequences · Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 20205/30 Basic Sequences An arithmetic sequence is a sequence in which the di erence between

  • View
    0

  • Download
    0

Embed Size (px)

Text of Lesson 6: Sequences · Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June...

  • Lesson 6: Sequences

    Adithya B., Brian L., William W., Daniel X.

    June 2020

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 1 / 30

  • Problem of the Week

    PotW

    Define

    f (n) =∞∑i=0

    gcd(n, i) · ix i

    If f (n) = Pn(x)Qn(x) for integer polynomials Pn, Qn which don’t share anycommon factors other than ±1, find the minimal positive integer n suchthat 2019|Pn(1)

    This sum at first glance looks pretty intractable. In particular, wewant to get rid of gcd(n, i)We can try splitting the sum into sums based on gcd. For example,we want to write it as

    f (n) =∑d |n

    ∞∑i=0

    d · (di)xdi

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 2 / 30

  • Problem of the Week

    This is incorrect! The coefficient of (i)x i

    is now∑

    d | gcd(n,i)d instead of

    gcd(n, i).

    However, recall that∑

    d | gcd(n,i)φ(d) = gcd(n, i), so if we write

    f (n) =∞∑i=0

    ix i

    ∑d | gcd(n,i)

    φ(d) we can now sumswap as

    ∑d |n

    φ(d)∞∑i=0

    (di)

    xdi

    Recall∞∑i=0

    ix i

    = x(x−1)2 , so this inside is

    dxd

    (xd−1)2

    So, f (n) =∑d |n

    dφ(d)xd

    (xd−1)2 . What should Qn(x) be?

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 3 / 30

  • Problem of the Week

    All denominators go into (xn − 1)2, so we should haveQn(x) = (x

    n − 1)2

    This means that

    Pn(x) =∑d |n

    dφ(d)xd(xn − 1)2

    (xd − 1)2=∑d |n

    dφ(d)xd(1 + xd + . . .+ xn−d)2

    When we plug in 1, we get

    Pn(x) =∑d |n

    dφ(d)(nd

    )2= n

    ∑d |n

    φ(d)n

    d

    The sum is a convolution! So, we only need to consider prime powers

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 4 / 30

  • Problem of the Week

    ∑d |pk

    φ(d) nd = pk + pk−1(p − 1) + pk−2 · p(p − 1) + . . ., which is

    pk−1(p + k(p − 1))So, if q|Pn(1), we either have q|n or q|(p + k(p − 1)) for some p|n.Now, we are ready to finish. If 2019|Pn(1), we need 3, 673|Pn(1).How can we get 3?

    We either choose 3|n or 3|(p + k(p − 1)). (p, k) = (2, 1) works and21 < 3

    For 673, if 673|(p + k(p − 1)), then we should have(k + 1)(p − 1) > 673. This basically shows that if k > 1, then pk will

    be at least(

    673k+1

    )kwhich is much too large. On the other hand,

    k = 1 admits (p, k) = (337, 1) which is small enough

    Our answer is n = 2 · 337 = 674

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 5 / 30

  • Basic Sequences

    An arithmetic sequence is a sequence in which the difference betweenany two consecutive terms is a constant

    a, a + d , a + 2d , a + 3d , . . .

    a is the first term, d is the common difference

    Each term is the average of the two adjacent terms

    A geometric sequence is a sequence in which the ratio between anyconsecutive two terms is a (nonzero ) constant

    a, ar , ar2, ar3, . . .

    a is the first term, r is the common ratio

    Each term is the geometric mean of the two adjacent terms

    It is very useful to write arithmetic/geometric sequences in terms oftwo parameters: one term and the common difference/ratio

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 6 / 30

  • Basic Sequences

    2003 AIME I #8

    In an increasing sequence of four positive integers, the first three termsform an arithmetic progression, the last three terms form a geometricprogression, and the first and fourth terms differ by 30. Find the sum ofthe four terms.

    Let’s write the first three terms as a− d , a, a + d instead ofa, a + d , a + 2d

    This makes the fourth term (a+d)2

    a :

    a− d , a, a + d , (a + d)2

    a

    Now we can write (a+d)2

    a − (a− d) = 30

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 7 / 30

  • 2003 AIME I #8

    We can simplify: (a + d)2 − a(a− d) = 30ad2 + 3ad = 30a

    Let’s solve for a in terms of d because this is a linear equation:

    a = d2

    30−3dWe know a, d must be positive integers, so 1 ≤ d ≤ 9We can narrow down d more: since 30− 3d is divisible by 3 we knowthat d2 is divisible by 3

    So d ∈ {3, 6, 9}d = 3 =⇒ a = 37d = 6 =⇒ a = 3; but a− d < 0 so this doesn’t workd = 9 =⇒ a = 27; gives

    18, 27, 36, 48

    So answer is 18 + 27 + 36 + 48 = 129Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 8 / 30

  • Basic Sequences

    2004 AIME II #9

    A sequence of positive integers with a1 = 1 and a9 + a10 = 646 is formedso that the first three terms are in geometric progression, the second,third, and fourth terms are in arithmetic progression, and, in general, forall n ≥ 1, the terms a2n−1, a2n, a2n+1 are in geometric progression, andthe terms a2n, a2n+1, and a2n+2 are in arithmetic progression. Let an bethe greatest term in this sequence that is less than 1000. Find n + an.

    Not completely arithmetic or geometric, but we can writea1 = 1, a2 = r , a3 = r

    2

    a2, a3, a4 in arithmetic progression so a4 = 2a3 − a2 = 2r2 − r

    a3, a4, a5 in geometric progression so a5 =a24a3

    = (2r2−r)2r2

    = (2r − 1)2

    a4, a5, a6 in arithmetic progression soa6 = 2a5 − a4 = 2(2r − 1)2 − r(2r − 1) = (3r − 2)(2r − 1)

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 9 / 30

  • 2004 AIME II #9

    a5, a6, a7 in geometric progression so

    a7 =a26a5

    = (3r−2)2(2r−1)2

    (2r−1)2 = (3r − 2)2

    Can continue:a8 = (4r − 3)(3r − 2)a9 = (4r − 3)2

    a10 = (5r − 4)(4r − 3)

    We know a9 + a10 = 646 so (4r − 3)2 + (5r − 4)(4r − 3) = 646Solve this to get the positive solution r = 5

    Now we can calculate all terms of the sequence: 1, 5, 25, 45, 81, . . .

    Can get that a16 = 957 is largest term less than 1000 so answer16 + 957 = 973

    Recommend trying the calculations on your own; good exercise inkeeping computations neat and expressions factored

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 10 / 30

  • Recursions

    Broadly speaking, recursions are sequences where the nth term isdefined by previous ones, such as xn = xn−1 + . . .+ x0 or xn =

    1xn−1

    + 1

    As they are a very broad class of sequences, there is no particularglobal method. However, keep an eye out for

    Periodicity: Check if a recursive equation might actually be hidingperiodicity, such as xn =

    1xn−1

    for an easy example

    Large scale behavior: See how the sequence behaves as a wholeGenerating functions: Many sequences are susceptible to be solvedusing generating functions, in a method similar to Snake Oil

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 11 / 30

  • Recursions

    2012 AIME I #11

    Let f1(x) =23 −

    33x+1 , and for n ≥ 2, define fn(x) = f1(fn−1(x)). The

    value of x that satisfies f1001(x) = x − 3 can be expressed in the form mn ,where m and n are relatively prime positive integers. Find m + n.

    To get a better feel for the sequence, let’s write out a few of theterms and see if we notice anything special.

    Note that

    f1(x) =2

    3− 3

    3x + 1,

    f2(x) =2

    3− 3

    3(23 −3

    3x+1) + 1=

    2

    3− 3x + 1

    3x − 2,

    f3(x) =2

    3− 3

    3(23 −3x+13x−2) + 1

    = x .

    The sequence is periodic!Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 12 / 30

  • 2012 AIME I #11

    Then, f4(x) = f1(x), so we have the period is 3.

    f1001(x) = f2(x) =23 −

    3x+13x−2 = x − 3.

    Multiply both sides by 3(3x − 2):

    2(3x − 2)− 3(3x + 1) = 3(3x − 2)(x − 3)

    −3x − 7 = 9x2 − 33x + 18 =⇒ 9x2 − 30x + 25 = 0

    This factors as (3x − 5)2, so x = 53 . The answer is 008.

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 13 / 30

  • Recursions

    2018 PUMaC Algebra #7

    Let the sequence {an}∞n=−2 satisfy a−1 = a−2 = 0, a0 = 1, and for allnon-negative integers n,

    n2 =n∑

    k=0

    an−kak−1 +n∑

    k=0

    an−kak−2.

    Given a2018 is rational, find the maximum integer m such that 2m divide

    the denominator of the reduced form of a2018.

    The sums look sort of similar to the Catalan number recursion:Cn+1 =

    ∑nk=0 CkCn−k .

    Let’s try generating functions. Let A(x) =∑∞

    n=0 anxn.

    The sum in the question can be written asn2 =

    ∑nk=0 an−k(ak−1 + ak−2).

    Let’s define bk = ak−1 + ak−2 so that n2 =

    ∑nk=0 an−kbk .

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 14 / 30

  • 2018 PUMaC Algebra #7

    Define the generating function for bi to be B(x). Let’s find A(x)B(x).

    (a0+a1x2 + a2x

    2 + · · · )(b0 + b1x + b2x2 + · · · )= a0b0 + (a0b1 + a1b0)x + (a0b2 + a1b1 + a2b0)x

    2 + · · ·

    = 02 + 12 · x + 22 · x2 + · · · =∞∑n=0

    n2xn

    Remember the following:

    2

    (1− x)3=∞∑n=0

    2

    (n + 2

    2

    )xn =

    ∞∑n=0

    (n2 + 3n + 2)xn.

    1

    (1− x)2=∞∑n=0

    (n + 1

    1

    )xn =

    ∞∑n=0

    (n + 1)xn

    1

    1− x=∞∑n=0

    xn

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 15 / 30

  • 2018 PUMaC Algebra #7

    Therefore,

    ∞∑n=0

    n2xn =2

    (1− x)3− 3

    (1− x)2+

    1

    1− x=

    x + x2

    (1− x)3= A(x)B(x)

    Now, our goal is to find A(x), so we want to find a way to relate A(x)and B(x).

    B(x) =∞∑n=0

    (an−1 + an−2)xn = x

    ∞∑n=0

    an−1xn−1 + x2

    ∞∑n=0

    an−2xn−2

    = (x + x2)A(x)

    Therefore, A(x)B(x) = (x + x2)A(x)2 = x+x2

    (1−x)3 , so

    A(x) =1

    (1− x)32

    .

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 16 / 30

  • 2018 PUMaC Algebra #7

    Lemma

    1

    (1− x)32

    =∞∑n=0

    2n + 1

    4n

    (2n

    n

    )xn.

    Proof.

    Try to expand with the binomial theorem!

    Note that a2018 =403742018

    (40362018

    ).

    Note that

    ν2

    ((4036

    2018

    ))= ν2(4036!)− 2ν2(2018!) = 4029− 2 · 2011 = 7.

    There are 4036 powers of 2 in the denominator and 7 in thenumerator, so the largest power in the denominator after simplifyingis 24029.

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 17 / 30

  • Linear Recursions

    A linear recurrence is one of the form

    an = c1an−1 + c2an−2 + . . .+ ckan−k

    Linear recurrences appear a lot, and one of the most important stepstowards understanding them is to find a closed form.

    Let’s use ideas from last week on generating functions to try to find aclosed form!

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 18 / 30

  • Linear Recursions

    Consider S =∑∞

    i=0 aixi . What is c1xS + c2x

    2S + . . .+ ckxkS?

    The coefficient of xn for n ≥ k in this expression isc1an−1 + c2an−2 + . . .+ ckan−k = an. So, it is around S . However,we aren’t guaranteed that xn for n < k has the right coefficient, sowe actually have

    c1xS + . . .+ ckxkS = S − P(x)

    for P(x) with degree < k

    So, solving for S ,

    S =P(x)

    1− c1x − c2x2 − . . .− ckxk

    Suppose that the polynomial in the denominator has roots r1, . . . , rk

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 19 / 30

  • Linear Recursions

    The denominator is −ck(x − r1)(x − r2) . . . (x − rk). So, we can usepartial fraction decomposition to get

    S =m1r1r1 − x

    +m2r2r2 − x

    + . . .+mk rkrk − x

    (for now we assume that all ri are distinct.)

    Now, if we write each term as its own generating function, rememberr1

    r1−x =∞∑i=0

    (xr1

    )i, so we will get

    S =∞∑n=0

    xnk∑

    i=1

    (1

    ri

    )nmi

    Equating coefficients, an = αn1m1 +α

    n2m2 + . . .+α

    nkmk where αi =

    1ri

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 20 / 30

  • Linear Recursions

    α1, . . . , αk are the roots of C (x) = xn − c1xn−1 − . . .− ck . We call

    this the characteristic polynomial

    The constants m1,m2, . . . ,mk can be solved for given the initialconditions

    Now, we will address root multiplicity. If a root has multiplicity 2, forexample, it will appear in the partial fraction decomposition as m+bx

    (r−x)2instead of mr−x . In the generating function, this will manifest as(p + qn)αn for some p, q. This idea generalizes, so if a root hasmultiplicity d , then the closed form has P(n)αn where P(n) is apolynomial in n of degree d − 1.Ex: If C (x) has roots 2, 2, 3, the general form will be (a+ bn)2n + c3n

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 21 / 30

  • Linear Recursions

    Brilliant

    A sequence xn is defined by x0 = −1, x1 = 0, x2 = 1 and the recurrencerelation

    xn = 6xn−1 − 12xn−2 + 8xn−3.

    Find the closed form of xn.

    This is a linear recurrence! Using our new terminology, what is itscharacteristic polynomial?Its characteristic polynomial is x3 − 6x2 + 12x − 8Notice that this can be factored into (x − 2)3Thus, we see that we can write xn as P(n)2

    n for some degree 2polynomial PNotice that we need P(0) = −1, P(1) = 0, P(2) = 14 .We write P(n) = an2 + bn + c and solve the resulting system.We get a = −38 , b =

    118 , c = −1, so the closed form is

    xn = (−38n2 + 118 n − 1)2

    n

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 22 / 30

  • Linear Recursions

    1990 AIME #15

    Find ax5 + by5 if the real numbers a, b, x , and y satisfy the equations

    ax + by = 3,

    ax2 + by2 = 7,

    ax3 + by3 = 16,

    ax4 + by4 = 42.

    We’ve already done this question before. How can we apply ourknowledge of linear recurrence to it?

    Notice that these terms look like consecutive terms of a linearrecurrence with characteristic polynomial with roots at x , y , soλ2 − (x + y)λ+ xy . Call this sequence tn = axn + byn

    Suppose we let u = x + y , v = −xy . Then, we havetn = utn−1 + vtn−2

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 23 / 30

  • 1990 AIME #15

    Now, we have 7u + 3v = 16, 16u + 7v = 42.

    Solving the system gives u = −14, v = 38.Thus, we find that the next term in the sequence,t5 = ax

    5 + by5 = −14 · 42 + 38 · 16 = 20.

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 24 / 30

  • Weird Sequences

    Unfortunately, most sequences elude easy characterization

    The majority of sequences are ”weird” and require ad hoc methods inorder to solve

    The ideas to solve such questions are similar to those for generalrecursions:

    Try to compute small terms if possible. Guess a pattern throughengineers induction and try to prove itLook at how the sequence behaves as a whole, and if there are anyoverarching global patternsBe on the look out for manipulations, such as factorizations andsubstitutions which will simplify how the sequence looksIf initial conditions are given, see if they are special by trying thequestion with your own conditions. This will tell you if they aresignificant or if you can replace them with variablesTry to prove subresults to get a better intuition with the sequence. Jotdown ideas you may have or qualities of the sequence you see, even ifthey have little to do with what we are actually trying to prove

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 25 / 30

  • Weird Sequences

    2017 CMIMC Algebra & Number Theory #9

    Define a sequence {an}∞n=1 via a1 = 1 and an+1 = an + b√anc for all

    n ≥ 1. What is the smallest N such that aN > 2017?

    Let’s first try to get a feel for the sequence. What happens when westart at ak = n

    2?

    After 2 moves, we are at ak+2 = n2 + 2n = (n + 1)2 − 1, and after a

    3rd, we get to ak+3 = (n + 1)2 + (n − 1)

    How about if we start at ak = n2 + i with 0 < i < n?

    After two turns we get to ak+2 = (n + 1)2 + (i − 1)

    After a square n2, it takes three turns to increase b√akc by 1, and weovershoot the next square by n − 1. After a nonsquare, we increaseb√akc after 2 turns, and our ”overshoot” decreases by 1

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 26 / 30

  • 2017 CMIMC Algebra & Number Theory #9

    So, if we start at a square n2, it will take 3 moves to get to(n + 1)2 + (n − 1), and 2 ∗ (n − 1) more to get to the next square at(2n)2.

    This tells us that the only squares in the sequence are 1, 4, 16, 64, . . .,and 4n+1 occurs 2(2n − 1) + 3 = 2n+1 + 1 terms after 4n

    As a1 = 40, 4n occurs at position

    1 + (2 + 1) + (4 + 1) + . . .+ (2n + 1) = 2n+1 + (n − 1)So, a26+4 = a68 = 1024

    By previous logic, a71 = (32 + 1)2 + 31, and after each pair of terms,

    the argument of the square increases by 1 while the outside”overshoot” decreases by 1

    We want to get close to 452, which is 12 away from 33. So, add 24more terms

    a95 = 452 + (31− 12) = 2025 + 19

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 27 / 30

  • 2017 CMIMC Algebra & Number Theory #9

    a94 = 2025 + 19− 44 < 2017, so our answer is 95

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 28 / 30

  • Weird Sequences

    Romania TST 2003/1

    Let (an)n≥1 be a sequence for real numbers given by a1 = 1/2 and foreach positive integer n

    an+1 =a2n

    a2n − an + 1.

    Prove that for every positive integer n we have a1 + a2 + · · ·+ an < 1.

    The recurrence doesn’t look very nice. How can we simplify it?

    Substituting bn =1an

    , we get bn+1 = b2n − bn + 1

    Now, it’s easy to compute terms of {bi}. We have b1 = 2, b2 = 3,b3 = 7, b4 = 43, b5 = 1807. Any patterns?

    We see bn+1 = b1b2 · · · bn + 1

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 29 / 30

  • Romania TST 2003/1

    To prove this, rearrange our equality as bn+1−1bn−1 = bn. Now, if wemultiply this telescopes

    b1b2 · · · bn = bn+1−1b1−1 = bn+1 − 1Now, we can substitute an+1 back in. We get that

    an+1 =1

    1 + b1b2 · · · bn=

    a1a2 · · · an1 + a1a2 · · · an

    We now get

    a1 · · · an1 + a1 · · · an

    = (a1 · · · an)−(a1 · · · an)2

    1 + a1 · · · an= (a1 · · · an)−(a1 · · · anan+1)

    a1 + a2 + . . .+ an telescopes! It becomes 1− a1a2 · · · an, so we aredone.

    Adithya B., Brian L., William W., Daniel X. Lesson 6: Sequences June 2020 30 / 30