CEMC Banner

Problem of the Month 2022-2023

Problem 0: September 2022

Problem

  1. Consider the integers 392, 487, 638, and 791. For each of these integers, do the following.

    1. Determine whether the integer is a multiple of 7.

    2. With the hundreds digit equal to A, the tens digit equal to B, and the units digit equal to C, compute 2A+3B+C.

    What do you notice?

  2. Suppose n=ABC is a three-digit integer (A is the hundreds digit, B is the tens digit, and C is the units digit). Show that if ABC is a multiple of 7, then 2A+3B+C is a multiple of 7.

  3. Show that if 2A+3B+C is a multiple of 7, then the three-digit integer n=ABC is a multiple of 7.

  4. Suppose ABCDEF is a six-digit integer that has each of its digits different from 0. Show that ABCDEF is a multiple of 7 if and only if BCDEFA is a multiple of 7.

  5. Think of ways to generalize the fact in part (d).

Hint

  1. No hint given.

  2. What are the remainders when 100 and 10 are divided by 7?

  3. No hint given.

  4. Try to find a condition on six-digit integers that detects divisibility by 7. There is a well-known general test for divisibility by 7, but it will be useful to find another one that is specific to six-digit integers and similar to the condition for three-digit integers implied by (b) and (c).

Solution

  1. In the table below, the first column contains the four integers given in the problem, the middle column says whether that integer is a multiple of 7, and the third column contains the value of 2A+3B+C.

    ABC Multiple of 7? 2A+3B+C
    392 yes (7×56) 35
    487 no 39
    638 no 29
    791 yes (7×113) 42

    The two integers that are multiples of 7 have the property that 2A+3B+C is also a multiple of 7, and the two integers that are not multiples of 7 have the property that 2A+3B+C is not a multiple of 7.

  2. The integer ABC is equal to 100A+10B+C. Observe that 100=7×14+2 and 10=7+3, so we have that ABC=100A+10B+C=[7(14)+2]A+(7+3)B+C=7(14A+B)+(2A+3B+C) which can then be rearranged to get ABC7(14A+B)=2A+3B+C.

    We are assuming that ABC is a multiple of 7, so the expression 2A+3B+C is equal to the difference of two multiples of 7, and so it must be a multiple of 7.

  3. Using the calculation from part (b), ABC=7(14A+B)+2A+3B+C for any three-digit positive integer ABC. If 2A+3B+C is a multiple of 7, then ABC is the sum of two multiples of 7 and so must be a multiple of 7.

  4. The combined result of parts (b) and (c) is that a three-digit integer ABC is a multiple of 7 if and only if the integer 2A+3B+C is a multiple of 7. To answer the question in this part, we will first establish a similar fact about six-digit integers.

    To do this, we first divide each of 10, 102, 103, 104, and 105 by 7 to find the quotient and remainder. 10=7+3102=7(14)+2103=7(142)+6104=7(1428)+4105=7(14285)+5

    Since ABCDEF=A×105+B×104+C×103+D×102+E×10+F, we can substitute the equations above and rearrange to get that ABCDEF=7(14285A+1428B+142C+14D+E)+(5A+4B+6C+2D+3E+F) and since 7(14285A+1428B+142C+14D+E) is a multiple of 7, a similar argument to those used in parts (b) and (c) imply that the integer ABCDEF is a multiple of 7 if and only if the quantity 5A+4B+6C+2D+3E+F is a multiple of 7.

    We will now prove that ABCDEF is a multiple of 7 if and only if BCDEFA is a multiple of 7. First, assume that ABCDEF is a multiple of 7. By the fact established above, the integer 5A+4B+6C+2D+3E+F is a multiple of 7. Though it may seem like a strange observation, this implies that 3(5A+4B+6C+2D+3E+F) must be a multiple of 7. Expanding and grouping some terms, we have 3(5A+4B+6C+2D+3E+F)=15A+12B+18C+6D+9E+3F=(14A+7B+14C+7E)+(A+5B+4C+6D+2E+3F)=7(2A+B+2C+E)+(5B+4C+6D+2E+3F+A) and so 7(2A+B+2C+E)+(5B+4C+6D+2E+3F+A) is a multiple of 7. This implies that 5B+4C+6D+2E+3F+A is a multiple of 7, and by the fact established above, the six-digit integer BCDEFA is a multiple of 7.

    We now suppose that BCDEFA is a multiple of 7. We have already shown above that if the digits are "cycled" to the left, then the integer obtained is also a multiple of 7. Applying this several times, we have that CDEFAB is a multiple of 7, as are DEFABC, EFABCD, FABCDE, and finally ABCDEF.

    As an example, you can verify for yourself that 314517 is a multiple of 7, and so are each of 145173, 451731, 517314, 173145, and 731451. Similarly, the integer 215739 is not a multiple of 7, and neither are any of 157392, 573921, 739215, 392157, and 921573.

    Note: The assumption that none of the digits of ABCDEF are zero implies that each of the integers obtained by cycling the digits is a six-digit integer. If we were to allow digits equal to 0, the claim remains true, but in practice we may need to include "leading zeros". For example, cycling the digits of the integer 300412 in this way would lead to 004123 (which is really a four-digit integer), then 041230, 412300, 123004, and so on.

  5. While we will not include proofs here, we will list a few ways that the result in (d) can be generalized.

Problem 1: October 2022

Problem

In any triangle, there is a unique circle called its incircle that can be drawn in such a way that it is tangent to all three sides of the triangle. For a given triangle, the radius of its incircle is known as its inradius and is denoted by r.

For each side of the triangle (which is tangent to the incircle), another tangent to the incircle can be drawn in such a way that it is parallel to that side. The three sides as well as these three new tangents give a total of six tangents to the incircle. They uniquely determine a hexagon that we will call the Seraj hexagon of the triangle.

Finally, for a given triangle, we will denote by s its semiperimeter, which is defined to be half of its perimeter.

The diagram below is of a triangle showing its incircle and Seraj hexagon.

  1. Sketch the 345 triangle with its incircle and Seraj hexagon. Compute its inradius, semiperimeter, and the area of its Seraj hexagon.

  2. Find a general expression for the area of a triangle in terms only of its inradius and semiperimeter.

  3. Find a general expression for the area of the Seraj hexagon of a triangle in terms of its three side lengths, its semiperimeter, and its inradius.

  4. What is the largest possible value that can be obtained by dividing the area of a triangle’s Seraj hexagon by the total area of the triangle?

Hint

  1. There are several ways to compute the area of the Seraj hexagon. One is to subtract the areas of three smaller triangles from that of the full triangle.

  2. From the centre of the incircle, draw a radius to each point of tangency the circle has with the triangle.

  3. Try to prove that 3(x2+y2+z2)(x+y+z)2 is true for all real numbers x, y, and z and determine a condition on x, y, and z that implies 3(x2+y2+z2)=(x+y+z)2.

Solution

Note: In this solution, we will denote by |ABC| the area of ABC. We will also use the following facts about circles.

Fact 1: Suppose a circle has centre O and P is a point on its circumference. The tangent to the circle at point P is perpendicular to the radius from O to P.

Fact 2: For any point Q outside of a circle, there are exactly two tangents to the circle that pass through Q. If the points of tangency are A and B, then AQ=BQ.

  1. Below is a picture of the triangle. Its vertices are labelled by A, B, and C with the right angle at C, AC=3, BC=4, and AB=5. The centre of the incircle is labelled by I, and AB, BC, and AC are tangent to the incircle at D, E, and F, respectively.

    Since the perimeter is 3+4+5=12, the semiperimeter is s=122=6.

    To compute r, we first use Fact 1 to get that IFC=IEC=90°. We are assuming that FCE=90° as well, and since the sum of the angles of a quadrilateral is always 360°, FIE=90°. Therefore, CFIE is a rectangle. Since IF and IE are radii of the incircle, IF=IE=r. Since CFIE is a rectangle, CF=CE=r.

    Using that CF=CE=r, we get BE=BCCE=4r and AF=ACCF=3r. By Fact 2, BD=BE and AD=AF, and since AB=5, 5=AB=AD+BD=AF+BE=(3r)+(4r)=72r This gives 5=72r, which can be solved for r to get r=1.

    In the diagram below, the Seraj hexagon has been added. The side of the Seraj hexagon that is parallel to AB (and tangent to the incircle) intersects BC at L and AC at M. The side of the Seraj hexagon that is parallel to BC intersects AC at G and AB at H. The side of the Seraj hexagon that is parallel to AC intersects AB at J and BC at K. The point of tangency of JK with the circle is labelled by N.

    To compute the area of the Seraj hexagon, we will compute the areas of MLC, AHG, and JBK and subtract their combined area from the area of ABC.

    To compute the area of MLC, we first set CM=x and CL=y. Since LM is parallel to AB, we have that CML=CAB and CLM=CBA. Since the two share a right angle at C, MLC is similar to ABC. Therefore, yx=CLCM=BCAC=43, or y=43x.

    From earlier, we have that CF=CE=1, which means FM=1x and EL=1y. By Fact 2, LM=EL+FM=2xy. By the Pythagorean theorem applied to CML and using that y=43x, we have CM2+CL2=LM2x2+y2=(2xy)2x2+(43x)2=(273x)2x2+169x2=4283x+499x20=83x2283x+40=2x27x+3(multiply by 34)0=(x3)(2x1) If x3=0, then M is at A, but AB and LM are distinct parallel lines, so they have no points in common. Therefore, 2x1=0 or x=12, so y=43×12=23. We can now compute |CML|=12xy=12×12×23=16

    We now compute the area of JBK. By Fact 1, IEK=INK=90°, and since JK is parallel to AC, EKN=90° as well. By reasoning similar to earlier, we conclude that INKE is a square of side-length r, which means EK=r. We also have that CE=r, so this means BK=BCCEEK=411=2.

    Since JK is parallel to AC, JBK is similar to ABC by reasoning similar to that which was used to show that MLC was similar to ABC. This means JKAC=BKBC or JK=AC×BKBC. Substituting AC=3, BK=2, and BC=4 into this equation, we get JK=32. Therefore, |JBK|=12×BK×JK=12×2×32=32

    Using very similar reasoning, one can show that |AHG|=23. Therefore, the area of the Seraj hexagon is |ABC||MLC||JBK||AHG|=12×4×3163223=113

  2. In the diagram below, a triangle has its incircle drawn. Radii are drawn from the centre of the incircle, I, to the points of tangency of AB, BC, and AC, which are labelled D, E, and F, respectively. As well, I is connected by line segments to each vertex of the triangle.

    Set AB=c, BC=a, and AC=b. With this notation, the semiperiemter of ABC is s=a+b+c2. Since ID, IE, and IF are radii to points of tangency, they are perpendicular to AB, BC, and AC, respectively. Therefore, they are altitudes of ABI, BCI, and CAI, respectively. These three triangles compose the entirety of ABC with no overlap, so the area of ABC is equal to the sum of their areas. Therefore, |ABC|=12×AB×ID+12×BC×IE+12×AC×IF=12cr+12ar+12br=r×a+b+c2=rs

    As an example demonstrating this formula, consider ABC from part (a). Using the usual area formula, |ABC|=12×3×4=6. From part (a), its semiperimeter is 3+4+52=6 and inradius is r=1, so rs=1×6=6, which is the correct area.

  3. In the diagram below, ABC has its incircle and Seraj hexagon drawn. The side of the Seraj hexagon that is parallel to BC intersects AB at D and AC at E. The side parallel to AB intersects AC at F and BC at G. The side parallel to AC intersects BC at H and AB at J. The altitude of ABC from A is also drawn and its points of intersection with BC and DE are labelled by K and L, respectively1.

    By construction, DE is parallel to BC. By reasoning similar to that which was used in earlier parts, this means ABC is similar to ADE and ABK is similar to ADL. These two pairs of similar triangles imply that DEBC=ADAB and ADAB=ALAK. We will call this common ratio k. The area of ADE can be computed in terms of k and the area of ABC as follows |ADE|=12(DE)(AL)=12(k(BC))(k(AK))=k2(12×BC×AK)=k2|ABC|

    We next examine the quantity k. Since DE and BC are different parallel tangents to the incircle and KL is perpendicular to both lines, the length of KL must be equal to the diameter of the incircle (you may want to think about why this is true). The diameter of the incircle is 2r, so KL=2r, which means AL=AK2r.

    Therefore, we have k=ALAK=AK2rAK=12rAK. From part (b), |ABC|=rs, but from the usual formula for the area of a triangle we also have |ABC|=12(BC)(AK). This implies 2rs=(BC)(AK) or AK=2rsBC. Substituting into the formula for k above, we have that k=12rAK=12r(BC)2rs=1BCs If we set AB=c, BC=a, and AC=b, then we get k=1as. Earlier, we showed that |ADE|=k2|ABC|, so |ADE|=(1as)2|ABC| By similar reasoning, we also have |JBH|=(1bs)2|ABC||FGC|=(1cs)2|ABC| The area of the Seraj hexagon is equal to the area of ABC minus the combined area of these three triangles, so using the formulas just above as well as |ABC|=rs, we have |DEFGHJ|=|ABC||ADE||JBH||FGC|=|ABC|[1(1as)2(1bs)2(1cs)2]=rs[1(1as)2(1bs)2(1cs)2]

  4. As suggested in the hint, we will show that 3(x2+y2+z2)(x+y+z)2 for all real numbers x, y, and z. To see this, note that the inequality is equivalent to the inequality 3(x2+y2+z2)(x+y+z)20 which, after expanding and rearranging the left side, is the same as 2(x2+y2+z2)2(xy+yz+zx)0 After further manipulation, this is equivalent to (xy)2+(yz)2+(zx)20 Therefore, the given inequality is true exactly when (xy)2+(yz)2+(zx)20. The sum of three squares is always non-negative, so this inequality is always true. Therefore, the given inequality is true for all real numbers x, y, and z, as claimed. Moreover, the only way that the quantity (xy)2+(yz)2+(zx)2 can be equal to 0 is when x=y=z, and hence, the only way that 3(x2+y2+z2)=(x+y+z)2 is when x=y=z.

    Dividing the expression for the area of the Seraj hexagon from part (c) by rs, we get that the ratio of the area of the Seraj hexagon to that of the triangle is 1(1as)2(1bs)2(1cs)2 Using the inequality established above, we can multiply by 13 to get that for any real numbers x, y, and z, x2y2z213(x+y+z)2. Applying this with x=1as, y=1bs, and z=1cs, we get that 1(1as)2(1bs)2(1cs)2=1x2y2z2113(x+y+z)2=113(1as+1bs+1cs)2=113(3a+b+cs)2=113(32ss)2=113=23 Therefore, the ratio is at most 23 in every triangle. By the remark at the end of the proof of the inequality, the ratio equals 23 exactly when 1as=1bs=1cs. Since s is always nonzero, this is equivalent to a=b=c. Therefore, the ratio is maximized when the triangle is equilateral. It is not difficult to explicitly show that the area of the Seraj hexagon in an equilateral triangle is equal to two thirds of the area of the triangle.


Footnotes
  1. If ABC or ACB is obtuse, then AK intersects some extensions DE and BC and not the line segments themselves. We leave it to the reader to verify that the argument that follows works even if AK does not pass through DE and BC.↩︎

Problem 2: November 2022

Problem

Let ϕ=1+521.61803. For integers dk,dk1,,d1,d0,d1,,dr, each equal to 0 or 1, the expression (dkdk1d2d1d0.d1d2dr)ϕ is called a base ϕ expansion and represents the real number dkϕk+dk1ϕk1++d1ϕ+d0+d1ϕ1+d2ϕ2++drϕr The integers dk through dr are called the digits of the expansion. For example, the base ϕ expansion 1101.011ϕ represents the real number (1×ϕ3)+(1×ϕ2)+(0×ϕ)+1+(0×ϕ1)+(1×ϕ2)+(1×ϕ3) which can be simplified to get ϕ3+ϕ2+1+1ϕ2+1ϕ3=(1+52)3+(1+52)2+1+(21+5)2+(21+5)3=16+858+6+254+1+46+25+816+85=(2+5)+(32+125)+1+(32125)(25)=4+25 and so 1101.011ϕ=4+25.

  1. What are the real numbers represented by 1011ϕ and 10000ϕ?

  2. Find a base ϕ expansion of the real number 4+35.

  3. Show that ϕ2=ϕ+1 and use this to deduce that ϕn+1=ϕn+ϕn1 for all integers n.

  4. Show that every positive integer has a base ϕ expansion and find a base ϕ expansion for each positive integer from 1 through 10. One approach is to prove and use the following two facts.

Hint

  1. No hint given.

  2. What is ϕ+1ϕ?

  3. No hint given.

  4. One way to prove the first fact is to show that if there are two consecutive digits equal to 1, then there is a base ϕ expansion with fewer non-zero digits. To prove the second fact, use the same idea as in the proof of the first fact, but in reverse.

Solution

  1. Expanding and simplifying, we have 1011ϕ=ϕ3+ϕ+1=(1+52)3+1+52+1=16+858+1+52+1=4+252+1+52+22=7+352

    10000ϕ=ϕ4=(1+52)4=(1+52)2(1+52)2=(6+254)(6+254)=56+24516=7+352 and so we see that 1011ϕ=10000ϕ

  2. There are several ways to approach this problem and we will demonstrate two of them. First, from the example given in the problem statement, we have that 4+25=ϕ3+ϕ2+1+1ϕ2+1ϕ3 and using the hint, we have that ϕ+1ϕ=1+52+21+5=1+52+2(51)4=5 and so 4+35=(4+25)+5=(ϕ3+ϕ2+1+1ϕ2+1ϕ3)+(ϕ+1ϕ)=1111.111

    Another approach is to use what might be called a "greedy algorithm". We first note that 4+3510.708204 and then consider powers of ϕ and find the first one that does not exceed it. As it turns out, ϕ46.854102 and ϕ511.090170. It can be checked that ϕ4=7+352, so if we let α=4+35, then αϕ4=8+6527+352=1+352 The approximate value of αϕ4 is 3.854102. Now we check that ϕ22.618034 and ϕ34.236068, so the largest power of ϕ that does not exceed αϕ4 is ϕ2, and it can be checked that αϕ4ϕ2=1+51.236068 Since ϕ0=1 and ϕ1=ϕ1.618034, the largest power of ϕ that does not exceed αϕ4ϕ2 is ϕ0=1, and so we now consider the quantity αϕ4ϕ21=2+50.236068 Considering ϕ taken to negative integer exponents, we find that ϕ30.236068, so we suspect that 2+5 is exactly equal to ϕ3. Indeed, (21+5)3=816+85=12+5=2+5 Therefore, αϕ4ϕ21=1ϕ3 which can be rearranged to get α=ϕ4+ϕ2+ϕ0+ϕ3, which means 4+35=10101.001. Notice that these two base ϕ expansions are different and both correct. A way to see that the expansions are equal is explained throughout the rest of the solution.

  3. Expanding ϕ2 and simplifying, we have ϕ2=(1+52)2=6+254=3+52=1+52+22=ϕ+1 Multiplying this equation by ϕn1 gives ϕn1+ϕn=ϕn+1. It will be useful in part (d) to note that this means that 011ϕ=100ϕ and more generally, if 011 ever occurs in a base ϕ expansion, it can be replaced by 100, or vice versa, without changing the actual value of the number being expressed.

  4. As suggested in the problem, we will use the facts in the bullet points. Specifically, we will use Fact 1 and Fact 2 below:

    Fact 1: If a real number n has a base ϕ expansion, then it has a base ϕ expansion that does not have two consecutive digits equal to 1.

    Fact 2: If a real number n has a base ϕ expansion, then it has a base ϕ expansion that has its units digit d0 equal to 0.

    Proof of Fact 1. Let n=dkdk1d2d1d0.d1d2dr be a base ϕ expansion of n. We will call the digit dm bad if dm=1 and at least one of dm+1 and dm1 is equal to 1. We want to show that n has a base ϕ expansion that has no bad digits.

    Observe that if n has an expansion with every digit equal to 0, then n must itself be the real number 0. This is because every power of ϕ is positive.

    Suppose the given expansion of n has at least one bad digit. Then we let m be the largest integer such that dm is bad. By definition, dm=1 and either dm+1=1 or dm1=1. However, it is not possible for dm+1=1 since this would imply that dm+1 is bad, but m is the largest integer such that dm is bad.

    Thus, we must have dm+1=0, dm=1, and dm1=1, and so the given expansion is n=dkdk1dm+2011dm2d1d0.d1d2dr By the remark at the end of part (c), we can replace the 011 by 100 to get that n=dkdk1dm+2100dm2dm2d1d0.d1d2dr

    Notice that we have found a base ϕ expansion of n with fewer non-zero digits, under the assumption that the expansion had at least one bad digit. In other words, if a base ϕ expansion of n has at least one bad digit, then there is a base ϕ expansion of n that has fewer non-zero digits. Thus, as long as there is a bad digit, we can decrease the number of non-zero digits.

    By the above remark, unless n=0, the number of nonzero digits cannot decrease indefinitely since there were finitely many digits to begin with. Thus, we must eventually lose the ability to decrease the number of nonzero digits, and by the previous paragraph, this means we must eventually reach a base ϕ expansion that has no bad digits. ◻

    Below is an example of the procedure explained in the proof of Fact 1. It is used to find a base ϕ expansion of n=1010101110011.1101ϕ that has no bad digits. There is a step where a leading 11 is replaced by 100. The digits are aligned in the equations to indicate where this happened. In every line except the last, the the digits that are changed in the subsequent line are highlighted. n=1010101110011.1101ϕ=1010110010011.1101ϕ=1011000010011.1101ϕ=1100000010011.1101ϕ=10000000010011.1101ϕ=10000000010100.1101ϕ=10000000010101.0001ϕ

    Proof of Fact 2. This can be shown by an argument rather similar to the proof of Fact 1. This time, we will introduce bad digits in order to remove a potential 1 from the units digit. Suppose n has a base ϕ expansion. By Fact 1, we can assume that the expansion n=dkdk1d2d1d0d1drϕ is a expansion without any bad digits. If d0=0, then there is nothing to do, so we assume that d0=1. We will now artificially add two "trailing" 0’s as digits. That is, we also have that n=dkdk1d2d1d0d1drdr1dr2 where dr1=dr2=0. Let m be the largest integer with 0>m and dm=dm1=0. Since we have added two trailing zeros, we know this must happen somewhere, so it is possible to choose m this way.

    By the choice of m, we must have that dm+1=1, and since the expansion has no bad digits, dm+2=0. By the choice of m, it then follows that dm+3=1, then since there are no bad digits, we get dm+4=0, and so on. Since d0=1, this alternating pattern must eventually reach d0=1. In other words, the expansion takes the form n=dkdk1d3d2d11.010101010100dm2dm3drdr1dr2 By part (c), we can change dm and dm1 to 1’s and compensate by changing dm+1 to 0. The new expansion is n=dkdk1d3d2d11.010101010011dm2dm3drdr1dr2 Repeating this process, we now change dm+1 and dm+2 to 1’s and change dm+3 to a 0. This process terminates in the expansion n=dkdk1d3d2d10.111111111dm2dm3dr which indeed has d0=0. ◻

    The procedure in the proof of Fact 2 is used below to find a base ϕ expansion of the number represented as n=100101001.01010101001010010001ϕ that has d0=0. As was done earlier, in each line but the last, the three digits highlighted are the ones that change in the subsequent line. n=100101001.01010101001010010001ϕn=100101001.01010100111010010001ϕn=100101001.01010011111010010001ϕn=100101001.01001111111010010001ϕn=100101001.00111111111010010001ϕn=100101000.11111111111010010001ϕ

    Now we will apply the facts to derive base ϕ expansions for the first ten positive integers.

    To start, we have that 1=1ϕ since 1=ϕ0. This means the integer 1 has a base ϕ expansion. Following the procedure outlined in the proof of Fact 2, 1=0.11ϕ. It is easy to add 1 to a base ϕ expansion that has d0=0 because we can simply change d0=1. Thus, we have that 2=1.11ϕ, and using the procedure from the proof of Fact 1 again, we get 2=10.01ϕ.

    Continuing in this way, if we have a base ϕ expansion of the integer n, then we can use the technique in the proof of Fact 1 to find a base ϕ expansion that does not have any bad digits. Then, if necessary, we can use the technique in the proof of Fact 2 to find a base ϕ expansion of n that has d0=0. From this, we can find a base ϕ expansion of n+1 by taking the base ϕ expansion of n and switching d0 from 0 to 1, which has the effect of adding 1. This process can be repeated to find a base ϕ expansion of n+2, then n+3, and so on. Starting with n=1, this is demonstrated up to n=10 below.

    1=1ϕ=1.00ϕ=0.11ϕ2=1.11ϕ=10.01ϕ3=11.01ϕ=100.01ϕ4=101.01ϕ=101.0100ϕ=101.0011ϕ=100.1111ϕ5=101.1111ϕ=110.0111ϕ6=111.0111ϕ=1001.1001ϕ=1010.0001ϕ7=1011.0001ϕ=1100.0001ϕ8=1101.0001ϕ=10000.1101ϕ9=10001.1101ϕ=10010.0101ϕ10=10011.0101ϕ=10100.0101ϕ

Problem 3: December 2022

Problem

This month’s problem is an extension of Problem 6 from the November 2022 Canadian Senior Mathematics Contest. Here is the original problem.

A bag contains exactly 15 marbles of which 3 are red, 5 are blue, and 7 are green. The marbles are chosen at random and removed one at a time from the bag until all of the marbles are removed. One colour of marble is the first to have 0 remaining in the bag. What is the probability that this colour is red?

Note: It might be useful to familiarize yourself with the notation of binomial coefficients before attempting this problem.

  1. Suppose there are r red marbles and b blue marbles. As in the original problem, the marbles are chosen at random and removed from the bag one at a time until all marbles are removed. One colour of marble is the first to have 0 marbles remaining in the bag. What is the probability that this colour is red?

  2. Suppose there are r red marbles, b blue marbles, and g green marbles. The marbles are chosen at random and removed one at a time until all marbles are removed. What is the probability that red is the colour of marble that is first to be completely removed from the bag?

  3. Suppose there are r red marbles, b blue marbles, and g green marbles with r<b<g. Let p(r) be the probability that the red marbles are the first to be completely removed from the bag and define p(b) and p(g) similarly. Determine which of p(r), p(b), and p(g) is the smallest and which is the largest. Does the result agree with your intuition?

  4. Show that the values of p(r), p(b), and p(g) depend only on the proportions of r, b, and g to the total number of marbles. For example, if one bag has r red, b blue, and g green marbles and another has 7r red, 7b blue, and 7g green marbles, then the probability that the red are removed first is the same for both bags.

Hint

  1. If the red marbles are all removed from the bag first, then what is the colour of the last marble to be removed from the bag?

  2. As in part (a), it is useful to think about the colour of the final marble to be removed. In part (a), the final colour alone determines which colour has completely removed first. In this part, it is a bit more complicated.

  3. Try to find a general expression for each of p(r), p(b), and p(g), simplifying as much as possible. Once you have done this, try to determine the sign of p(r)p(b).

  4. One way to approach this is to compute the probabilities directly in terms of the proportions. Thinking about which colour is removed last will likely be helpful, as in earlier parts. Another approach is to use a general formula for the probabilities in terms of r, b, and g, and divide the numerator and denominator by (r+b+g)2.

Solution

  1. Suppose there are r red marbles and b blue marbles and set n=r+b. Upon removing the n marbles from the bag in random order, we can record the order in which they emerged from the bag by a sequence of R’s and B’s. For example, if the first two marbles were red and the third was blue, then the sequence would begin with RRB. If the fourth was red, then the sequence would continue RRBR, and so on.

    An important observation in this part and later parts of the solution is that every possible sequence of n characters, r of which are R and b of which are B, is equally likely to occur through this process. To make this observation, we first imagine labelling the red marbles by R1, R2, and so on through to Rr, and the blue marbles by B1, B2, and so on through to Bb. With this labelling, we have made it so that the n marbles are distinct. There are exactly n! orders in which the marbles can be removed, and each of them is equally likely. If we now imagine listing these n! possible orderings of R1,,Rr,B1,,Bb and removing the subscripts, each possible sequence of r R’s and b B’s will occur in the list exactly (r!)(b!) times. Therefore, if we remove the (unindexed) marbles and write down the sequence of R’s and B’s, each possible sequence will occur with probability exactly r!b!n!=1(nr). Hence, every sequence occurs with the same probability. Notice that (nr) is equal to the number of sequences of r R’s and b B’s since any such sequence is completely determined by selecting r of the n possible positions and placing R in them.

    Therefore, the probability that the red marbles are removed first is equal to the number of sequences of r R’s and b B’s with the property that there is at least one B to the right of the rightmost R, divided by (nr).

    Since there are only two colours in this part of the problem, the statement "there is at least one B to the right of the rightmost R" is equivalent to "the final letter in the sequence is B". Put in a different way, the red marbles are completely removed first if and only if a blue marble is removed last. Therefore, the probability that we seek is simply the number of sequences of R’s and B’s that end in B, divided by (nr). The number of such sequences is equal to (n1r) since, to construct all such sequences, we can place one B at the end, and then place the r R’s in any of the other n1 positions. Therefore, the probability that all the red marbles are removed first is (n1r)(nr)=(n1)!r!(nr1)!n!r!(nr)!=(n1)!r!(nr)!r!(nr1)!n!=nrn=br+b Looking ahead to later parts, notice that this probability is equal to the proportion of the marbles that are blue.

  2. Consider the following two events:

    To say that the red marbles were removed first is the same as saying either Event X occurred or Event Y occurred. Since Event X has blue as the final marble and Event Y has green as the final marble, Event X and Event Y cannot occur simultaneously, so this means that the probability the red marbles are removed first is the sum of the probabilities of Event X and Event Y. Therefore, we can compute the desired probability by computing the probabilities of Events X and Y and adding the results together.

    For both of these probabilities, we need to count the total number of ways that the marbles can be removed. As in part (a), we will think of an order that the marbles can be removed in as a sequence of r R’s, b B’s, and g G’s. There are (r+b+gr) ways to place the r R’s. After doing this, there will be b+g empty positions, so there are (b+gb) ways to place the b B’s. Once the R’s and B’s are placed, there is no choice of where to place the G’s, so the total number of sequences is (r+b+gr)(b+gb)=(r+b+g)!(b+g)!r!(b+g)!b!g!=(r+b+g)!r!b!g!

    Note: This expression is an example of something called a multinomial coefficient, which is a generalization of a binomial coefficient. We will not use the notation of multinomial coefficients in this solution, but you might like to read about them if you have not before.

    We will compute the number of sequences that end in B and have at least one G to the right of the rightmost R. This quantity divided by (r+b+g)!r!b!g! is the probability that Event X occurs.

    There are (r+b+g1b1) ways to place the B’s so that the final letter in the sequence is B. This is because we need to place one B in the final position, then place the b1 remaining B’s in the remaining r+b+g1 positions.

    For any such placement of the B’s, in order to place the R’s and G’s so that at least one G occurs to the right of the rightmost R, we need to place a G in the rightmost empty position. Thus, for every such way to place the B’s, we now have (r+g1g1) ways to place the G’s. This is because we must place one G in the rightmost position that is not occupied by a B, and then the remaining g1 G’s can be placed in any of the remaining r+g1 positions. Once the B’s and G’s are placed, there is no choice of where to place the R’s, so the probability that Event X occurs is r!b!g!(r+b+g)!(r+b+g1b1)(r+g1g1)=r!b!g!(r+b+g)!×(r+b+g1)!(r+g1)!(b1)!(r+g)!(g1)!r!=bg(r+b+g)(r+g) By a very similar calculation, it can be shown that the probability that Event Y occurs is bg(r+b+g)(r+b) and so the probability that all the red marbles are removed from the bag first is bg(r+b+g)(r+g)+bg(r+b+g)(r+b)=bgr+b+g(1r+g+1r+b)

  3. In part (b), we showed that p(r)=bgr+b+g(1r+g+1r+b). Following nearly identical reasoning, it can be shown that p(b)=rgr+b+g(1r+b+1b+g)p(g)=rbr+b+g(1r+g+1b+g) Using the equations above, we will show that p(b)p(r) is negative. This result will show that p(r) is greater than p(b). Remember that we are assuming r<b<g in this part. p(b)p(r)=rgr+b+g(1r+b+1b+g)bgr+b+g(1r+g+1r+b)=gr+b+g(rr+b+rb+gbr+gbr+b) Since r, b, and g are all positive, the quantity gr+b+g is positive, which means p(b)p(r) is negative if and only if rr+b+rb+gbr+gbr+b is negative. Using a common denominator of (r+b)(b+g)(r+g), we get r(b+g)(r+g)+r(r+b)(r+g)b(r+b)(b+g)b(b+g)(r+g)(r+b)(b+g)(r+g) Noting that the denominator (r+b)(b+g)(r+g) is also positive, we have that p(b)p(r) is negative if and only if the numerator of the fraction above is negative. Manipulating the numerator, we have r(b+g)(r+g)+r(r+b)(r+g)b(r+b)(b+g)b(b+g)(r+g)=r(r+g)(b+g+r+b)b(b+g)(r+b+r+g)=(r2+rg)(r+2b+g)(b2+bg)(2r+b+g)=r3+2r2b+r2g+r2g+2rbg+rg22rb2b3b2g2rbgb2gbg2=r3+2r2b+2r2g+rg22rb2b32b2gbg2 At first, it might seem that there is no hope of understanding the expression above. However, if we imagine the situation where r=b, then by symmetry we really should have that p(r)=p(b) (in the problem, we are assuming that r<b, but the equation above is not aware that we plan to impose this restriction). This means the expression p(b)p(r) should evaluate to 0 when r=b, so it should have a factor of rb. Indeed, if we group the terms that "look" alike, it is easier to notice the factor of (rb): r3+2r2b+2r2g+rg22rb2b32b2gbg2=(r3b3)+2(r2brb2)+2(r2gb2g)+(rg2bg2)=(rb)(r2+rb+b2)+(rb)2rb+(rb)2g(r+b)+(rb)g2=(rb)[(r2+rb+b2)+2rb+2g(r+b)+g2] Since r<b is given, we now have that p(b)p(r) is negative if and only if the quantity (r2+rb+b2)+2rb+2g(r+b)+g2 is positive, but each of r, b, and g is positive, so it is indeed positive!

    Therefore, we have that p(b)p(r)<0, or p(b)<p(r). Similar calculations can be used to show that p(g)<p(b). Therefore, the marble colour with the smallest number of representatives is most likely to be removed first, and the marble colour with the largest number of representatives is least likely to be removed first.

  4. Let f(r)=rr+b+g, f(b)=br+b+g, and f(g)=gr+b+g. That is, f(r) is the proportion of the marbles that are red, and similarly for f(b) and f(g).

    From part (b), the probability that all the red marbles are removed first, p(r), is bg(r+b+g)(r+g)+bg(r+b+g)(r+b) Dividing the numerator and denominator of each expression by (r+b+g)2, the probability above is equal to bg(r+b+g)2r+gr+b+g+bg(r+b+g)2r+br+b+g=br+b+g×gr+b+grr+b+g+gr+b+g+br+b+g×gr+b+grr+b+g+br+b+g=f(b)f(g)f(r)+f(g)+f(b)f(g)f(r)+f(b)

    So we have written the probability that all the red marbles are removed first in terms of the proportions of each of the three colours.

    We will now try to explain why the formula above makes sense. Once again, we will think of a way of drawing the marbles randomly as a sequence of R’s, B’s, and G’s. In any given position, the proportion of sequences with a B in that position is f(b). In particular, f(b) is the probability that the final letter in the sequence is B.

    The quantity f(g)f(r)+f(g) is equal to the proportion of green marbles among those marbles that are either red or green. Similar to the reasoning above, this means that if we look at sequences of R’s, B’s, and G’s the quantity f(g)f(r)+f(g) is the probability that G is the rightmost letter among R’s and G’s.

    The overall rightmost letter being equal to B is independent of the probability that the rightmost letter among R’s and G’s is G, so the quantity f(b)f(g)f(r)+f(g)=f(b)×f(g)f(r)+f(g) is equal to the probability that the rightmost letter in the sequence is a B and among R’s and G’s, the rightmost letter is G. Similarly, the quantity f(b)f(g)f(r)+f(b) is equal to the probability that the rightmost letter is G and among R’s and B’s, the rightmost letter is B. The R’s all occur before the final G and before the final B if and only if one of these two events occurs, so this explains why the probability that all the red marbles are removed first is equal to

    p(r)=f(b)f(g)f(r)+f(g)+f(b)f(g)f(r)+f(b) This expression is in terms of the proportions of red, blue, and green marbles. Similar expressions can be computed for p(b) and p(g).

Problem 4: January 2023

Problem

For each positive integer k, define a function pk(n)=1k+2k+3k++nk for each integer n. That is, pk(n) is the sum of the first n perfect kth powers. It is well known that p1(n)=n(n+1)2.

  1. Fix a positive integer n. Let S be the set of ordered triples (a,b,c) of integers between 1 and n+1, inclusive, that also satisfy a<c and b<c. Show that there are exactly p2(n) elements in the set S.

  2. With S as in part (a), show that there are (n+12)+2(n+13) elements in S and use this to show that p2(n)=n(n+1)(2n+1)6

  3. For each k, show that there are constants a2,a3,,ak,ak+1 such that pk(n)=a2(n+12)+a3(n+13)++ak(n+1k)+ak+1(n+1k+1) for all n.

    Note: Actually computing the constants gets more and more difficult as k gets larger. While you might want to compute them for some small k, in this problem we only intend that you argue that the constants always exist, not that you deduce exactly what they are.

  4. Use part (c) to show that p3(n)=n2(n+1)24 and p4(n)=n(n+1)(2n+1)(3n2+3n1)30.

  5. It follows from the fact in part (c) that pk(n) is a polynomial of degree k+1. With k=5, this means there are constants c0,c1,c2,c3,c4,c5, and c6 such that p5(n)=c0+c1n+c2n2+c3n3+c4n4+c5n5+c6n6 Use the fact that p5(1)=1 and p5(n)p5(n1)=n5 for all n2 to determine c0 through c6, and hence, derive a formula for p5(n).

  6. Show that n(n+1) is a factor of pk(n) for every positive integer k and that 2n+1 is a factor of pk(n) for every even positive integer k.

Hint

  1. What are the possible values of c?

  2. How many distinct integers can occur in a triple in S?

  3. Try to generalize the idea in part (c). The constants a2 through ak+1 do not depend on n.

  4. For positive integers u and v with u<v, the usual convention is that (uv)=0. This convention makes sense for (at least) two reasons. First, there are zero ways to choose v objects from u distinct objects if u<v, so "u choose v" should be equal to 0. Second, the formula for (uv) given by (uv)=u(u1)(u2)(uv+1)v! will have a factor of 0 in the numerator if u<v.

  5. Directly compute an expression for p5(n)p5(n1). It should be a polynomial with coefficients depending on a1 through a6. By equating coefficients with the polynomial n5, solve for a1 through a6. After these coefficients are known, a0 can be computed from p5(1)=1.

  6. A polynomial with infinitely many roots must be the constant zero polynomial. Using this fact, show that pk(n)pk(n1)=nk for all real numbers, not just positive integers. This means you need to "extend" pk(n) to accept inputs that are not positive integers. Once this is done, determine the values of pk(0) and pk(1). To show that 2n+1 is a factor of pk(n) for even k, consider the values of pk(n) when n is a positive integer.

Solution

  1. Since a and b are positive integers and c is larger than both of them, the smallest value that c can take is c=2. The possible values of c are therefore c=2, c=3, and so on up to c=n+1.

    The only triple in S with the property that c=2 is (1,1,2), so there is one triple with c=2. The triples in S with c=3 are (1,1,3), (1,2,3), (2,1,3), and (2,2,3), so there are four triples with c=3.

    In general, if c=r, then a and b can both be any integer from 1 through r1 inclusive. Thus, there are (r1)×(r1)=(r1)2 triples in S with c=r. Since r ranges from 2 through n+1, there are exactly 12+22+32+42++(n1)2+n2=p2(n) triples in S.

  2. We will now count the triples in S by considering them according to the number of distinct integers that occur in the triple. For example, there are two distinct integers in (1,1,2) and three distinct integers in (1,5,7).

    If (a,b,c) is in S, then there are at most three distinct integers in the triple (since there are only three integers in total). As well, since a<c, the integers cannot all be equal. Therefore, there are either two distinct integers or three distinct integers in (a,b,c).

    Suppose x, y, and z are three distinct integers between 1 and n+1 inclusive. Since they are distinct, one of them is the largest. Assuming z is the largest, the triples (x,y,z) and (y,x,z) are both in S, and these are the only triples in S that contain the integers x, y, and z. Therefore, for every way to choose three distinct integers between 1 and n+1 inclusive, there are two triples in S. This observation means there are 2(n+13) triples in S with three distinct integers in them.

    Now suppose that x and y are two distinct integers with x<y. Then the only triple in S that contains exactly the integers x and y is (x,x,y). Thus, for every two distinct integers between 1 and n+1 inclusive, there is exactly one triple in S that contains exactly those two integers. Therefore, there are (n+12) triples in S with two distinct integers in them.

    Therefore, the number of elements in S is (n+12)+2(n+13).

    From part (a), p2(n)=(n+12)+2(n+13)=(n+1)!2!(n1)!+2(n+1)!3!(n2)!=(n+1)n2+2(n+1)n(n1)6=n(n+1)(12+n13)=n(n+1)(36+2(n1)6)=n(n+1)(3+2n2)6=n(n+1)(2n+1)6

  3. Fix a positive integer n. Using the idea from parts (a) and (b), we let Sk be the set of ordered lists of k+1 positive integers (x1,x2,x3,,xk,xk+1) with the property that each integer xi is between 1 and n+1 inclusive and xk+1 is larger than every other integer in the list. A list of the form (x1,x2,x3,,xk,xk+1) is called a (k+1)-tuple.

    As in the case with k=2, it is not possible for a (k+1)-tuple in Sk to have xk+1=1. This is because the other integers are positive and xk+1 must be the largest integer in the list (it cannot be "tied" for the largest). The possible values of xk+1 are 2 through n+1.

    For a fixed value of xk+1, say xk+1=r, if (x1,x2,x3,,xk,xk+1) is in Sk, then x1 through xk can each be any positive integer less than r, of which there are r1. Therefore, the number of (k+1)-tuples in Sk with xk+1=r is (r1)2. The possible values of r are 2 through n+1, so we have that the number of elements in Sk is 1k+2k+3k++(n1)k+nk=pk(n)

    Following the reasoning of part (b), we now want to count the elements in Sk a different way. Since xk+1 is the largest integer in the (k+1)-tuple, there are at least two distinct integers in every (k+1)-tuple in Sk. As well, there are at most k+1 distinct integers in every (k+1)-tuple. Suppose we have chosen r distinct positive integers between 1 and n+1 inclusive with 2rk+1. We would like to count the (k+1)-tuples in Sk that contain exactly those r integers. For example, suppose k=4 and r=3. We need to count the number of 5-tuples that use exactly three given integers with the largest integer occurring only in the rightmost position. Suppose the largest integer is C and the other two are A and B. The 5-tuples in Sk are

    (A,A,A,B,C), (A,A,B,A,C), (A,B,A,A,C), (B,A,A,A,C), (B,B,B,A,C), (B,B,A,B,C), (B,A,B,B,C), (A,B,B,B,C), (A,A,B,B,C), (A,B,A,B,C), (A,B,B,A,C), (B,A,A,B,C), (B,A,B,A,C), (B,B,A,A,C)

    and so there are 14 5-tuples in Sk with exactly those three integers. This means that there are 14(n+13) 5-tuples in Sk that have exactly three distinct integers in them. The important thing to notice here is that the constant 14 does not depend on n. We could do a similar count to see how many 9-tuples there are in S8 with exactly five distinct integers. The combinatorics might be a bit tedious, but in the end, we would find that the number of 9-tuples in S8 with exactly five distinct integers is some multiple of (n+15) where the multiplier does not depend on n.

    Putting this together, there must be some constants a2,,ak+1 so that pk(n)=a2(n+12)+a3(n+13)++ak(n+1k)+ak+1(n+1k+1) where each coefficient ar is equal to the number of (k+1)-tuples in Sk that contain exactly a fixed set of r distinct integers.

    Put differently, suppose R is a set of r distinct positive integers. Then ar is the number of (k+1)-tuples that satisfy the following three conditions: every integer in the (k+1)-tuple comes from R, every integer in R occurs at least once in the (k+1)-tuple, and the largest integer in R occurs exactly once and is in the rightmost position.

    Before moving on, we make one final observation. With the convention that (uv)=0 when u<v, the equation above makes sense even when n+1 is smaller than the bottom number in the binomial coefficient. For example, if k=5 and n=2, then the term a4(n+14)=a4(34) is counting the number of 6-tuples consisting of four distinct integers between 1 and n+1=3 inclusive. There is no way to choose four distinct integers from the list 1, 2, 3, so there should be zero such 6-tuples, and the fact that (34)=0 records this observation.

  4. From part (c), we have that p3(n)=a2(n+12)+a3(n+13)+a4(n+14) for some constants a2, a3, and a4. Using that p3(1)=13=1, we have that 1=p3(1)=a2(1+12)+a3(1+13)+a4(1+14)=a2(22)+a3(23)+a4(24)=a2+0+0 and so a2=1. With n=2, we have p3(2)=13+23=9, so 9=p2(2)=(2+12)+a3(2+13)+a4(2+14)=(32)+a3(33)+a4(34)=3+a3+0 and so a3=6. Finally, using n=3, we have p3(3)=13+23+33=36, so 36=p3(3)=(42)+6(43)+a4(44)=6+6×4+a4 from which it follows that a4=6. Recall that a4 is equal to the number of four-tuples in S3 consisting of a fixed set of four distinct integers. Indeed, the largest integer must go in the rightmost position, and there are 6 ways to arrange the other three integers, so a4=6 makes sense from a combinatorial perspective.

    We now have shown that p3(n)=(n+12)+6(n+13)+6(n+14)=(n+1)n2+6(n+1)n(n1)6+6(n+1)n(n1)(n2)24 and after some simplification, we get that p3(n)=n2(n+1)24

    We can approach p4(n) similar to how p3(n) was approached above. We start with p4(n)=a2(n+12)+a3(n+13)+a4(n+14)+a5(n+15) and then use that p4(1)=1, p4(2)=14+24=17, p4(3)=14+24+34=98, and p4(4)=14+24+34+44=354 to solve for a2, a3, a4, and a5. After doing this, we find that a2=1, a3=14, a4=36, and a5=24. Therefore, after some simplification, we get

    p4(n)=(n+12)+14(n+13)+36(n+14)+24(n+15)=n(n+1)(2n+1)(3n2+3n1)30

  5. Using that p5(n)=c0+c1n+c2n2+c3n3+c4n4+c5n5+c6n6, we can find a general expression for p5(n)p5(n1). n5=p5(n)p5(n1)=c0+c1n+c2n2+c3n3+c4n4+c5n5+c6n6(c0+c1(n1)+c2(n1)2+c3(n1)3+c4(n1)4+c5(n1)5+c6(n1)6)=c0+c1n+c2n2+c3n3+c4n4+c5n5+c6n6c0c1(n1)c2(n22n+1)c3(n33n2+3n1)c4(n44n3+6n24n+1)c5(n55n4+10n310n2+5n1)c6(n66n5+15n420n3+15n26n+1) and after collecting like terms, we get n5=(c1c2+c3c4+c5c6)+(2c23c3+4c45c5+6c6)n+(3c36c4+10c515c6)n2+(4c410c5+20c6)n3+(5c515c6)n4+6c6n5 We can now equate coefficients to get the system of equations 6c6=15c515c6=04c410c5+20c6=03c36c4+10c515c6=02c23c3+4c45c5+6c6=0c1c2+c3c4+c5c6=0 From the first equation, we get c6=16. Substituting this into the second equation gives 5c515×16=0 so c5=12. Continuing this way, we get that c4=512, c3=0, c2=112, and c1=0. Therefore p5(n)=c0112n2+512n4+12n5+16n6 To solve for c0, we can use that p5(1)=1 to get the equation 1=c0112+512+12+16=c0+1 which means c0=0. Finally, we can rearrange p5(n) into a nicer form p5(n)=112n2+512n4+12n5+16n6=n2+5n4+6n5+2n612=n2(n+1)2(2n2+2n1)12

  6. Fix a positive integer k and consider the function pk(n). We observed earlier that pk(n) is a polynomial in n. While pk(n) is designed to output 1k+2k++nk when n is a positive integer, there is nothing to stop us from "symbolically" evaluating pk(n) when n is not an integer. For example, even though p1(14) does not have the same meaning as p1(n) when n is a positive integer (we cannot "add together the first 14 positive integers"), we can still substitute 14 into the formula for p1 to get p1(14)=14×542=532.

    Now consider the function fk(n)=pk(n)pk(n1)nk where n is allowed to be any real number. The function fk(n) is the sum/difference of three polynomials, so it is itself a polynomial. Since pk(n)pk(n1)=nk for all positive integers n, n is a root of fk(n) for all positive integers n. By the fact in the hint, a polynomial with infinitely many roots must be the constant zero function, so pk(n)pk(n1)nk=0 for all real numbers n.

    With n=1, we get that pk(1)pk(0)=1k=1, but since pk(1)=1, we have that 1pk(0)=1, so pk(0)=0. Similarly, by considering n=0, we get that pk(0)pk(1)=0k, and since pk(0)=0, we have 0pk(1)=0, so pk(1)=0 as well. We have shown that 0 and 1 are roots of the polynomial pk(n), which shows that n and n+1 are factors of pk(n). This means n(n+1) is a factor of pk(n).

    We now suppose that k is even, which means nk=(n)k for all real numbers n. From above, we have that pk(0)=pk(1)=0. Considering pk(n)pk(n1)=nk at n=1, we have that pk(1)pk(2)=(1)k, and since k is even and pk(1)=0, we have pk(2)=1k or pk(2)=1k.

    Next, we use pk(n)pk(n1)=nk with n=2 to get pk(2)pk(3)=(2)k=2k, and since pk(2)=1k, this means pk(3)=1k+2k or pk(3)=(1k+2k).

    Continuing this way, we have pk(3)pk(4)=(3)k=3k, so 1k2kpk(4)=3k, and so pk(4)=(1k+2k+3k). We have now shown that pk(n)=pk(n1) for the positive integers n=0, n=1, n=2, n=3, and n=4. This pattern continues. It can be proven using mathematical induction that pk(n)=pk(n1) for all positive integers n.

    This means that pk(n)+pk(n1)=0 for every non-negative integer. Therefore, the polynomial pk(n)+pk(n1) has infinitely many roots, and so must be equal to 0 for every real number n.

    Taking n=12, we get pk(12)+pk(121)=0 which simplifies to 2pk(12)=0. Therefore, 12 is a root of pk(n) when k is even. Thus, pk(n) has a factor of n+12, which is equivalent to having a factor of 2n+1=2(n+12).

Problem 5: February 2023

Problem

The sequence (1,3,5,2,1,2,1) has the property that every integer in the sequence is a divisor of the sum of the integers adjacent to it. That is, 1 is a divisor of 3, 3 is a divisor of 1+5=6, 5 is a divisor of 3+2=5, and so on.

For n3, the sequence (a1,a2,a3,,an) of positive integers is called a splendid sequence of length n if it satisfies conditions S1, S2, and S3 found below.

For example, (1,3,5,2,1,2,1) is a splendid sequence because it satisfies S1, S2, and S3. The sequence (2,4,6,2) satisfies S1 and S2, but it is not a splendid sequence because it fails S3 since 2 is a divisor of every integer in the sequence.

For n=2, (a1,a2) is a splendid sequence of length 2 if it satisfies S1 and S3. Mostly for notational convenience, we also define a splendid sequence of length 1 to be the "sequence" (1). That is, the only splendid sequence of length 1 consists of a single integer equal to 1.

  1. Show that there is only one splendid sequence of length 2.

  2. Show that there is at least one splendid sequence of every possible length n1.

  3. Suppose (a1,a2,a3,,an) is a splendid sequence of length n2. Show that for every integer i with 1in1 there is a positive integer c so that (a1,a2,,ai,c,ai+1,,an) is a splendid sequence of length n+1.

  4. Suppose (a1,a2,a3,,an) is a splendid sequence of length n. Show that a1=an=1.

  5. For each n1, show that there are only finitely many splendid sequences of length n.

  6. Find a closed form for the number of splendid sequences of length n. Your answer should be an expression in terms of n.

Note: In part (f), we are asking you to find a closed form for the number of splendid sequences, the existence of which immediately implies that there are only finitely many. Hence, one way to answer part (e) is to answer part (f). With that said, we decided to include part (e) because it can be done without part (f) and (at least as far as we can tell) it is quite a bit easier than part (f). Part (f) is very challenging, so the hint will have more detail than usual.

Hint

  1. Remember the condition that no prime number can divide every integer in a splendid sequence.

  2. Think of an integer that is a divisor of every integer.

  3. Try the positive integer c=ai+ai+1.

  4. Prove that if the divisibility conditions (S1 and S2 in the problem statement) are satisfied by (a1,a2,a3,,an), then a1 and an must both divide every integer in the sequence.

  5. Try to write down a few splendid sequences of length at least 5. With the hint for (c) in mind, what do you notice about the largest integer in a splendid sequence? Show that, for each n, there is a largest possible value that an integer in any splendid sequence of length n can take. For instance, it can be shown that in a splendid sequence of length n2, every integer must be less than 2n2.

  6. There is a famous sequence called the Catalan numbers where the nth Catalan number equal to 1n+1(2nn). The Catalan numbers arise in many interesting ways in mathematics. One such way is that the nth Catalan number is equal to the number of sequences (b1,b2,,bn) of length n with the following properties.

    In the solution, such sequences will be called tame sequences. One way to answer this question is to show that the number of tame sequences of length n1 is equal to the number of splendid sequences of length n and use the closed form for the number of tame sequences. To do this, we suggest trying to devise a way to use a tame sequence of length n1 as "instructions" to construct a splendid sequence of length n. The idea from part (c) will probably be important.

    Note: In the solution, we will provide a proof that the number of tame sequences of length n is the nth Catalan number. You might want to try to prove this yourself, but we recommend taking it for granted when trying to solve part (f).

Solution

Definition 1: For integers a and b, we say that a divides b if there is an integer c with the property that ac=b. In this case, we write ab.

The phrases "a is a divisor of b" and "b is a multiple of a" both have the exact same meaning as "a divides b". Notice that, by this definition, every integer is a divisor of 0, but the only divisor of 0 is 0 itself. We give a few facts that will be used in this solution. Their proofs are not included.

Fact 1: If a and b are positive integers such that ab, then ab.

Fact 2: If a, b, and c are integers such that ab and ac, then a(bc) and a(b+c).

Fact 3: If a, b, and c are integers such that ab and bc, then ac.

  1. Suppose (a,b) is a splendid sequence. By definition, this means ab and ba. Since the integers in a splendid sequence must be positive, Fact 1 implies that ab and ba, which implies a=b. If p is a prime number such that pa, then pb by Fact 3. However, no prime number can divide both a and b because (a,b) is splendid. Therefore, no prime number divides a. Similarly, no prime number divides b, and so a=b=1.

    Therefore, the only splendid sequence of length 2 is (1,1).

  2. There are several "generic" sequences that one might find. The simplest is probably the sequence (1,1,1,,1). That is, the sequence (a1,a2,a3,,an) with ai=1 for all i is always a splendid sequence. This is because no prime number divides 1, and 1 divides every integer. Another splendid sequence is (1,2,3,4,,n1,1). For each integer k in this sequence, other than the 1’s on the end and n1, the integers next to it are k1 and k+1, so their sum is (k1)+(k+1)=2k, which is a multiple of k. The integers next to n1 are n2 and 1, which have a sum of n1.

In the remaining parts of the solution as well as in the Appendix, we will often denote a sequence by a bold letter. For example, we might refer to the sequence (a1,a2,,an) by x.

  1. Assume that x=(a1,a2,,an) is a splendid sequence. We will show that y=(a1,a2,,ai,c,ai+1,,an) is a splendid sequence when c=ai+ai+1.

    If some prime number p divides every integer in y, then it also divides every integer in x. Since x is a splendid sequence, there is no such prime number, so no prime number divides all of the integers in y.

    If i=1, then y=(a1,c,a2,a3,,an) and c=a1+a2. Since x is a splendid sequence, a1a2. We also have that a1a1, so a1(a1+a2) or a1c by Fact 2. Since every integer divides itself, c(a1+a2). To see that a2(c+a3), we note that a2(a1+a3) because x is splendid and a2a2 because every integer divides itself. By Fact 2, a2(a1+a2+a3) so a2(c+a3). The integers a3 through an all have exactly the same neighbours in y as they do in x, which is a splendid sequence, so y satisfies all other divisibility conditions required for it to be a splendid sequence.

    If i=n1, then y is splendid by a similar argument to the one in the previous paragraph.

    If 1<i<n1, then y=(a1,a2,,ai1,ai,c,ai+1,ai+2,,an). When k<i and when k>i+1, ak divides the sum of its neighbours because it has the exact same neighbours as it did in x. In y, the neighbours of the integer ai are ai1 and c. Since x is a splendid sequence, ai(ai1+ai+1). We also have that aiai, and so by Fact 2, ai(ai+ai1+ai+1) which means ai(ai1+c). By similar reasoning, ai+1(c+ai+2). The integer c is equal to the sum of its neighbours in y by definition, so it also divides the sum of its neighbours. Therefore, every integer in y divides the sum of its neighbours. We already argued that no prime number divides every integer in y, so y is a splendid sequence.

  2. Suppose x=(a1,a2,a3,,an) is a splendid sequence. If n=2, then the solution to part (a) implies that a1=an=1.

    Suppose n3. By definition, we have that anan1 and that an1(an2+an). By Fact 3, an(an2+an). Since anan, we can apply Fact 2 to get that an(an2+anan) which implies that anan2.

    Since x is splendid, we also have that an2(an3+an1). We have just shown that an divides an2, so by Fact 3, an(an3+an1). We also have that anan1, so Fact 2 implies an(an3+an1an1) or anan3. Continuing in this way, we can show that anai for all i with 1in. By the condition that no prime number can divide every integer in x, we conclude that an=1. Essentially the same argument shows that a1=1.

  3. Most of the work is to prove these two claims.

    Claim 1: If (a1,a2,,an) is a splendid sequence of length n3 that contains at least one integer that is greater than 1, then there is some i with 1<n such that ai=ai1+ai+1 and (a1,a2,,ai1,ai+1,ai+2,,an) is a splendid sequence. That is, there is an integer in the sequence that is equal to the sum of its neighbours, and if it is removed, the remaining shorter sequence is a splendid sequence.

    Claim 2: If (a1,a2,,an) is a splendid sequence of length n2, then ai2n2 for every i.

    Proof of Claim 1. To prove Claim 1, suppose x=(a1,a2,,an) is a splendid sequence with at least one integer greater than 1 and let i be such that ai is the largest integer in the sequence, choosing the rightmost occurrence if there is a "tie". More precisely, i is the largest integer with the property that aiaj for all 1jn.

    By part (d), an=a1=1, and since there is at least one integer in x that is greater than 1, neither a1 nor an can be the largest integer in x, which means 1<i<n. The choice of i ensures that ai1ai and ai+1ai. If ai=ai+1, then since ai is the largest integer in the sequence, this would imply that ai is not the rightmost occurrence of the largest integer in the sequence. Therefore, we actually have that ai+1<ai.

    The inequalities ai1ai and ai+1<ai imply that ai1+ai+1<2ai and since x is splendid, ai(ai1+ai+1). As well, all integers in a splendid sequence are positive, which means that ai1+ai+1 is a positive multiple of ai that is less than 2ai. The only such multiple is ai itself, and so ai1+ai+1=ai.

    We have shown that one of the integers in x is equal to the sum of its neighbours. To finish proving the claim, we need to show that y=(a1,a2,,ai1,ai+1,ai+2,,an) is a splendid sequence. In y, only ai1 and ai+1 have different neighbours than they did in x, so the divisibility conditions we need to verify are that ai1(ai2+ai+1) and ai+1(ai1+ai+2)

    We know that ai1(ai2+ai) and we have just shown that ai=ai1+ai+1. Substituting, we get that ai1(ai2+ai1+ai+1). By Fact 2, ai1(ai2+ai1+ai+1ai1) or ai1(ai2+ai+1). A nearly identical argument shows that ai+1(ai1+ai+2). Therefore, y satisfies the divisibility conditions.

    If a prime number p divides every integer in y, then pai1 and pai+1, so pai by Fact 2 since ai=ai1+ai+1. This would mean p divides every integer in x, which is not the case since x is splendid. ◻

    We will now prove Claim 2 by mathematical induction. The essence of the proof is that, by Claim 1, the largest integer in a splendid sequence must be the sum of two integers in a shorter splendid sequence. Therefore, the maximum size of an integer in a splendid sequence of length n+1 is at most twice the maximum size of an integer in a splendid sequence of length n. This means that there is always a fixed upper bound on the size of integers in a splendid sequence of a fixed length.

    Proof of Claim 2. To get an idea of how the induction will work, we first prove this for n=2, n=3, and n=4. For n=2, we showed in the solution to part (a) that the only splendid sequence of length 2 is (1,1). The largest element in this sequence is 1=20=222=2n2, so the claim holds for n=2.

    Now suppose (a1,a2,a3) is a splendid sequence of length 3. If a1=a2=a3=1, then every integer in the sequence is less than 232=2. Otherwise, since a1=a3=1 by part (d), Claim 1 implies that a2=a1+a3=1+1=2 is the largest integer in the sequence, so all integers in the sequence are at most 2=232.

    Continuing to n=4, suppose (a1,a2,a3,a4) is a splendid sequence. Again, if the sequence consists entirely of 1’s, then ai242=4 for all i. Otherwise, either (a1,a3,a4) is a splendid sequence of length 3 and a2=a1+a3, or (a1,a2,a4) is a splendid sequence of length 3 and a3=a2+a4. Either way, three of the four integers are in a splendid sequence of length 3, and the fourth is the sum of two integers in a splendid sequence of length 3. We just showed that an integer in a splendid sequence of length 3 is at most 232, so an integer in a splendid sequence of length 4 is at most 232+232=2×232=242. Therefore, no integer in the sequence (a1,a2,a3,a4) can exceed 242.

    Now for the inductive step. Suppose, for some n2, that every integer in every splendid sequence of length n is at most 2n2. This is our inductive hypothesis. Consider a splendid sequence (a1,a2,,an,an+1) of length n+1. If ai=1 for all i, then ai2n2 for all i. Otherwise, Claim 1 implies that there is some i so that ai=ai1+ai+1 and (a1,a2,,ai1,ai+1,,an,an+1) is a splendid sequence of length n. By the inductive hypothesis, this means each of a1, a2, a3, , ai1, ai+1, , an, and an+1 is at most 2n2, and since 2n2<2(n+1)2, each of these integers is at most 2(n+1)2. For ai, we have ai=ai1+ai+1 and since ai12n2 and ai+12n2, we conclude that ai2n2+2n2=2(2n2)=2(n+1)2 as well. We have shown that every integer in a splendid sequence of length n+1 is at most 2(n+1)1. This completes the induction and the proof. ◻

    By Claim 2, every integer in a splendid sequence of length n is at most 2n2. There are only finitely many sequences of length n consisting of positive integers less than or equal to 2n2, regardless of whether they are splendid. Therefore, for fixed n, there are only finitely many splendid sequences of length n.

The proof of part (f) will use some language about sets. Specifically, we will use the language of injective, surjective, and bijective functions. If you have seen this before, you should be ready to read the solution to part (f). Otherwise, we recommend reading Appendix 1 first.

  1. As pointed out in the hint, the number of splendid sequences of length n is equal to the (n1)st Catalan number. The nth Catalan number is equal to 1n+1(2nn), so the number of splendid sequences of length n is 1n(2n2n1). The sequence of Catalan numbers shows up in many contexts. A useful example for this solution is given in Definition 2.

    Definition 2: For each positive integer n1, we call a sequence (b1,b2,,bn) of positive integers a tame sequence if b1=1 and bk+1bk+1 for every integer k with 1k<n. In other words, b1=1 and every other integer in the sequence is at most 1 more than the previous integer.

    The name tame sequence was made up for the purpose of this solution, but it is known that the number of tame sequences of length n is equal to the nth Catalan number. There are proofs of this in various places in the literature. For completeness, we have included a proof in Appendix 2. It is stated as Claim 5.

    Let Tn denote the set of tame sequences of length n and Sn denote the set of splendid sequences of length n. We will show, for n2, that there is a bijection with domain Tn1 and codomain Sn. By the discussion in Appendix 1, this will show that the number of splendid sequences of length n is the (n1)st Catalan number.

    Recall from part (c) that if (a1,a2,,an) is a splendid sequence of length n, then (a1,a2,a3,,ai,ai+ai+1,ai+1,,an) is a splendid sequence of length n+1.

    From this point on, it will be notationally useful to prepend a zero at the beginning of splendid sequences. For example, the sequence (0,1) will now be the unique splendid sequence of length 1. The sequence (0,1,2,5,3,1) is a splendid sequence of length 5. This means that a splendid sequence of length n now has n+1 integers, the first of which is 0. For instance, a1=0, a2=1, a3=2, a4=5, a5=3, and a6=1 is how we would index the sequence (0,1,2,5,3,1) going forward. Notice that the observation from part (c) mentioned above also works if we insert the sum between the first and second integers, 0 and 1. You should convince yourself of this before moving on.

    For each n2, we define a function, fn, with domain Tn1 and codomain Sn. The way fn works is to use a tame sequence as a list of instructions to build a splendid sequence. Consider a tame sequence x=(b1,b2,,bn1) of length n1. Starting with (0,1), the unique splendid sequence of length 1, we read x from left to right and each integer in the tame sequence tells us where to insert a sum to get a longer splendid sequence. Specifically, in the kth step, the integer bk tells us that we should insert a sum between abk and abk+1 to get a longer splendid sequence.

    For example, suppose n=6 and the tame sequence is x=(1,2,3,2,1,1). Start with (0,1), which has a1=0 and a1=1. The first integer in x is 1, so in the first step we insert the sum between a1 and a2. This means we go from (0,1) to (0,0+1,1)=(0,1,1). To start the second step, we reindex to a1=0, a2=1, and a3=1. The next integer in x is 2, so we insert the sum between a2 and a3 to get (0,1,1+1,1)=(0,1,2,1). The next integer in x is 3, so we insert the sum between the third and fourth integers in the current splendid sequence to get (0,1,2,2+1,1)=(0,1,2,3,1). Continuing, we get (0,1,1+2,2,3,1)=(0,1,3,2,3,1), followed by (0,0+1,1,3,2,3,1)=(0,1,1,3,2,3,1), and finally (0,0+1,1,1,3,2,3,1)=(0,1,1,1,3,2,3,1). Thus, f7(x)=(0,1,1,1,3,2,3,1).

    By part (c), if x is a tame sequence of length n1, then fn(x) is a splendid sequence of length n. Also note that at the start of the kth step, the splendid sequence has k+1 integers in it. Because of the way tame sequences are defined, the kth integer in a tame sequence is at most k, so at each step, the splendid sequence is always long enough for the instruction to makes sense.

    For each n2, we will show that the function fn is a bijection. The proof will be by induction, but we first need a definition and then a useful fact.

    Definition 3: For a splendid sequence (a1,a2,a3,,an+1) of length n (remember that a1=0), we say that ai is a peak if ai=ai1+ai+1.

    By Claim 1 (see the solution to part (e)), every splendid sequence with an integer greater than 1 has at least one peak. Moreover, if that peak is "removed", the resulting shorter sequence is splendid. As well, with our new notation, if there is no integer greater than 1, then the sequence is of the form (0,1,1,1,,1) and the first (leftmost) 1 is its only peak. If it is removed, the resulting shorter sequence is also splendid. Indeed, the reason for introducing the 0 at the beginning was to avoid having to treat the sequence of all 1’s separately in this part of the argument.

    Now for the useful fact:

    Claim 3: Suppose y=(a1,a2,,an+1) is a splendid sequence of length n and that x=(b1,b2,,bn1) is a tame sequence of length n1 such that fn(x)=y. If we let bn1=m, then am+1 is the leftmost peak of y.

    A proof of Claim 3 is given at the end. We will now prove by induction that fn is a bijection for all n2.

    It was observed in part (a) that the only splendid sequence of length 2 is y=(0,1,1). As well, the only tame sequence of length 21=1 is x=(1). It is easily checked that f2(x)=y. The sets T1 and S2 each have only one element. There is only one function between two sets with one element, and it is always a bijection (convincing yourself of this is a good exercise in understanding definitions). Therefore, f2 is a bijection.

    For the inductive hypothesis, we assume for some n2 that fn is a bijection.

    We will show that fn+1 is a bijection, which means we need to show that it is injective and surjective. To show that it is surjective, we assume that y=(a1,a2,,an,an+1,an+2) is in Sn+1 and let ak be its leftmost peak. By Claim 1 from the solution to part (e), the sequence z=(a1,a2,,ak1,ak+1,,an,an+1,an+2) is in Sn. Since fn is a bijection by the inductive hypothesis, it is surjective, so there is some tame sequence w=(b1,b2,,bn1) in Tn1 with fn1(w)=z. For convenience, let m=bn1.

    Recall that the leftmost peak of x is ak. Note that k1 since a1=0 can never be a peak. Therefore, k2 and so k11.

    Suppose ar is the leftmost peak of z. If rk2, then ar is a peak of y because ar has the same neighbours in y and z when rk2. However, ak was chosen to be the leftmost peak of y, so we cannot have rk2. This means rk1, but by Claim 3, r=m+1, so we get k1m+1. Combining with 1k1, we have that 1k1m+1=bn1+1, which means the sequence (b1,b2,,bn1,k1) is a tame sequence. We will call this tame sequence x.

    To recap, the tame sequence x is obtained by appending k1 to w, the splendid sequence y is obtained by inserting the sum between the (k1)st and kth integer in z, and fn(w)=z. It follows that fn+1(x)=y. We have found xTn such that fn+1(x)=y. Since y was an arbitrary element of Sn+1, this concludes the proof that fn+1 is surjective.

    We will now show that fn+1 is injective. To do this, we suppose x=(b1,b2,,bn) and w=(c1,c2,,cn) are in Tn with fn+1(x)=fn+1(w). We will show that x=w.

    Let y=(a1,a2,,an+1,an+2) be such that y=fn+1(x)=fn+1(w). Suppose ak is the leftmost peak of y. By Claim 3, both cn=k1 and bn=k1. This shows that cn=bn. As well, if we set u=(b1,b2,,bn1) and v=(c1,c2,,cn1) and z=(a1,a2,,ak1,ak+1,,an+1,an+2), then fn(u)=fn(v)=z. By the inductive hypothesis, fn is bijective, and hence, it is injective, so u=v. This shows that x and w have the same first n1 integers, and since bn=cn as well, we have that x=w, which concludes the proof that fn+1 is injective.

    We have now shown that fn+1 is bijective, which proves that Tn1 and Sn have the same number of elements when n2. Therefore, the number of splendid sequences of length n is 1n(2n2n1) as claimed earlier.

    Proof of Claim 3. The proof is by induction on n. It was noted earlier that the only tame sequence of length 21=1 is x=(1) (b1=1), the only splendid sequence of length 2 is y=(0,1,1) (a1=0, a2=1, a3=1), and that f2(x)=y. The leftmost peak of y is a2 and 2=b1+1. This shows that Claim 3 is true when n=2.

    For the inductive hypothesis, we suppose, for some n2, that if y=(a1,a2,,an,an+1) is a splendid sequence of length n and x=(b1,b2,,bn1) is a tame sequence of length n1 such that fn(x)=y, then the leftmost peak of the y is am+1 where m=bn1.

    Suppose y=(a1,a2,,an,an+1,an+2) is a splendid sequence of length n+1 and that x=(b1,b2,,bn) is a tame sequence of length n with fn+1(x)=y. Because of how fn+1 is applied, am+1 is a peak of y. As well, z=(a1,a2,,am,am+2,,an+1,an+2) is a splendid sequence of length n such that fn(w)=z where w=(b1,b2,,bn1). For convenience, set bn=m and bn1=k. Suppose the leftmost peak of y is ar for some r. For now, assume r<m+1. It is not difficult to show that it is impossible for a splendid sequence to have two consecutive peaks. This means we must have rm1 since r must be at least two less than m+1. If this happens, ar is also a peak of z because am1 has exactly the same neighbours in z and y. By the inductive hypothesis, ak+1 is the leftmost peak of z, so r=k+1 and we get k+1m1. Since z is a tame sequence, bnbn1+1 or mk+1. This implies that mk+1m1 so mm1, which is impossible. Therefore, we cannot have r<m+1, which means am+1 is indeed the leftmost peak of y. This completes the induction and the proof. ◻

Appendix 1

Suppose X and Y are finite sets, where by "set" we mean an unordered collection of objects. Suppose there is a "rule" that, for every element in the set X, produces an element in the set Y. For instance, if the sets were X={(1,2),(5,3),(1,2)} and Y={(4,1),(5,2),(9,5)} (both sets of three ordered pairs), the "rule" might be "square the second entry, then reverse the order". With this rule, (1,2) becomes (4,1), (5,3) becomes (9,5), and (1,2) becomes (4,1), so every element of X is transformed into an element of Y. Such a rule is called a function. The set X is called its "domain" and Y is called its "codomain". If the function is named f, we would use f(x) to denote the function applied to an element x in the domain. You have probably seen functions before where the domain and codomain are all or part of the set of real numbers, but the notion of a function applies in a much broader context. Below are three important properties that functions may (or may not) have.

Injectivity: A function f with domain X and codomain Y is called injective if for every two elements of the domain, x1 and x2, if x1x2, then f(x1)f(x2). In other words, a function is injective if its application to two different elements of the domain always gives two different results. Note that when trying to prove that a function is injective, we typically assume that f(x1)=f(x2) and deduce that x1=x2. You might want to think about this logic.

Surjectivity: A function f with domain X and codomain Y is called surjective if for every yY there exists an xX so that f(x)=y. In other words, a function is surjective if every element of the codomain is the result of applying f to some element in the domain. [We might also say that the range equals the codomain to describe surjectivity.]

Bijectivity: A function f is with domain X and codomain Y is called bijective or is a bijection if it is both injective and surjective.

There is a lot to be said about injective, surjective, and bijective functions, but for us, the useful observation will be that if X and Y are finite sets and there is a bijective function f with domain X and codomain Y, then X and Y have the same number of elements. Indeed, if X has m elements and Y has n elements, then being injective implies that mn and being surjective implies that mn. Thus, being bijective implies that mnm, so m=n.

Observe that the example given at the beginning of this appendix is neither injective nor surjective, so it is not bijective. However, X and Y do have the same number of elements. It is important to keep in mind that we are only claiming that if there is a bijection from X to Y, then they have the same number of elements. There are six bijective functions from X to Y, the example we gave just happens to not be one of them.

Appendix 2

We will now show that the number of tame sequences of length n is equal to the nth Catalan number, 1n+1(2nn). The proof relies on the material from Appendix 1. As well, the results here are well known and proofs of them can be found in the literature.

Definition 4: For each positive integer n, a sequence of 2n integers is called a jagged sequence of length 2n if properties P1 and P2 hold:

Claim 4: There are 1n+1(2nn) jagged sequences of length 2n.

Proof of Claim 4. Fix a positive integer n. Let X be the set of sequences of 2n integers that satisfy P1 and fail P2. Also, let Y be the set of sequences of 2n integers, n+1 of which equal 1 and n1 of which equal 1. We will show that X and Y have the same number of elements.

Suppose x=(a1,a2,,a2n) is in X. Since x fails P2, there must be some k with 1k2n and the property that the sum of the first k entries is negative. Let k be the smallest such position in the sequence. If a1=1, then k=1. This means n of the integers in the list a2,a3,,a2n are equal to 1, and n1 of them are equal to 1. Therefore, the sequence (a1,a2,a3,,a2n) has n+1 integers equal to 1 and n1 integers equal to 1, which means it is in Y.

If k1, then a10, a1+a20, and so on up to a1+a2++ak10, but a1+a2++ak<0. Since a1+a2++ak10 but a1+a2++ak1+ak<0, we must have that ak is negative, but ak=±1, so ak=1. As well, each of the ai are integers, so the two sums above are integers, which means a1+a2++ak1=0 and a1+a2++ak1+ak=1 (there is no other way to add 1 to a non negative integer and get a negative integer). The fact that a1+a2++ak1=0 implies that exactly half of the integers in the list a1,,ak1 are equal to 1, and so the number of 1’s in (a1,a2,,ak) is one more than the number of 1’s. Since the number of 1’s and 1’s is equal in x, this means the number of 1’s in (ak+1,,a2n) is one more than the number of 1’s. All of this implies that (a1,a2,,ak,ak+1,ak+2,,a2n) has two more 1’s than 1’s. Two numbers that differ by 2 and have a sum of 2n must be n1 and n+1, so the sequence above is in Y.

The above work defines a function, that we will call f, with domain X and codomain Y. Specifically, if x=(a1,a2,,a2n) in X and k the smallest integer such that a1+a2++ak<0, f(x)=(a1,a2,,ak,ak+1,,a2n). That is, f(x) is the sequence obtained by negating every integer from ak+1 to the end of the sequence. We will show that f is a bijection.

To see that f is injective, suppose w=(a1,a2,,a2n) and x=(b1,b2,,b2n) are in X with f(w)=f(x). We suppose that k is the smallest such that a1+a2++ak<0 and m is the smallest such that b1+b2++bm<0. We might as well assume that km. Our assumption says that the sequences (a1,a2,,ak,ak+1,ak+1,,a2n) and (b1,b2,,bk,bm+1,bm+1,,b2n) are equal. Since km, this means ai=bi when 1ik and when m+1i2n. Observe that a1+a2++ak=b1+b2++bk, and since a1+a2++ak<0 by assumption, we get that b1+b2++bk<0. This means mk as well and so k=m. Since ai=bi when 1ik and k+1i2n, we have that ai=bi for all i. In other words, w=x, so f is injective.

Now suppose y=(c1,c2,c3,,c2n) is a sequence is in Y. Because yY, exactly n+1 of the integers in y are equal to 1 and n1 of them are equal to 1. Consider the list of sums c1c1+c2c1+c2+c3c1+c2+c3++c2n The first "sum", c1, is either 1 or 1. The final sum is (n1)(n+1)=2. As we move from one sum to the next in the list above, we add ci for some i, which means the sums either increase or decrease by 1 as we move down the list. Therefore, there is at least one sum that equals 1 (it could be the first). Suppose k is the smallest such that c1+c2+c3++ck=1. Then the sequence x=(c1,c2,,ck,ck+1,ck+2,,c2n) is in X and f(x)=y. To see that xS, we have that c1+c2++ck=1 and c1+c2++c2n=2, ad so it must be that ck+1+ck+1++c2n=1. Therefore, c1+c2+c3++ck+(ck+1)+(ck+2)++(c2n)=0. This means x has the same number of 1’s and 1’s, which means there are n of each. As well, the sequence fails P2 because the first k integers have a negative sum. This shows that xX, and that f(x)=y is essentially by the definition of x. Therefore, f is surjective, which completes the proof that it is a bijection.

The number of sequences in Y is (2nn+1). This is because we can choose where to put the 1’s in (2nn+1) ways, and then there is no choice of where to place the 1’s. By what we have shown, we now know that there are (2nn+1) sequences in X as well.

We can now compute the number of jagged sequences. The number of sequences of 2n integers that satisfy P1 is (2nn) by reasoning similar to that in the previous paragraph. To get the number of jagged sequences of length 2n, we need to subtract from (2nn) the number of sequences that satisfy P1 but fail P2, which is exactly the number of sequences in X. Therefore, the number of jagged sequences is (2nn)(2nn+1)=(2n)!n!n!(2n)!(n+1)!(n1)!=(2n)!n!(n1)!(1n1n+1)=(2n)!n!(n1)!×1n(n+1)=1n+1×(2n)!n!n!=1n+1(2nn)

Claim 5: The number of tame sequences of length n is 1n+1(2nn).

Proof of Claim 5. We will find a bijection from the set of jagged sequences of length 2n to the number of tame sequences of length n.

Suppose x=(a1,a2,,a2n) is jagged and that i1<i2<<in are the indices where the 1’s occur. That is, ai1=ai2==ain=1 and all other integers in x are equal to 1. We will now define a sequence y=(b1,b2,b3,,bn) so that bk is the sum of the integers in x from a1 up to and including the kth integer equal to 1. In symbols, bk=a1+a2++aik.

Of the first ik integers in x, exactly k of them are equal to 1 and the other ikk of them are equal to 1. Therefore, their sum (which is bk by definition), is bk=k(ikk)=2kik. Thus, for a jagged sequence x=(a1,a2,,a2n), we define f(x) to be the sequence (b1,b2,,bn) where bk=2kik.

We will show that f is a bijection, but we first need to confirm that f(x) is always tame, which means we need to show that b1=1, bk1 for all k, and that bk+1bk+1 for all k<n. We know that a1=1 by P2, so this means i1=1 and b1=2(1)i1=21=1. Suppose ik2k. In x, there are only k 1’s up to and including aik, which means that among the first ik integers in x, there are at least as many 1’s as 1’s. This means the sum of the first ik integers cannot be positive. Therefore, we must have that ik<2k, and since both are integers, ik+12k, which rearranges to 12kik, which gives bk1. To see that bk+1bk+1, note that ik+1ik+1, so ikik+11. Then bk+1bk=2(k+1)ik+1(2kik)=2k+2ik+12k+ik=2+ikik+121=1 and so bk+1bk1 or bk+1bk+1. This completes the proof that f(x) is tame.

To see that f is injective, notice that bk=2kik can be rearranged to get ik=2kbk. In other words, if f(x)=y, then ik is uniquely determined from bk. This means that from y, the positions of the 1’s in x are uniquely determined, so the entirety of x is uniquely determined by y. This means there is only one x with the property that f(x)=y, so f is injective.

To see that f is surjective, suppose y=(b1,b2,,bn) is a tame sequence. For each k from 1 through n, define ik=2kbk, then define x=(a1,a2,,a2n) so that aj=1 if j=ik for some k, and aj=1 otherwise.

That f(x)=y follows by rearranging ik=2kbk to get bk=2kik. However, to conclude that f is surjective, we need to verify that x is indeed a jagged sequence.

By one of the conditions of tameness, b1=1, so so we have that i1=2(1)1=1. Using the assumption that bk+1bk+1 which can be rearranged to bkbk+11, we get that ik+1ik=2(k+1)bk+1(2kbk)=2k+2bk+12k+bk=2+bkbk+12+(1)=1 which means ik+1ik1 and it follows that ik+1>ik. Finally, since bn is positive, in=2nbn<2n. We have shown that 1=i1<i2<<in<2n. This shows that all of the ik are distinct, so x satisfies P1.

Rearranging ik=2kbk, we get bk=k(ikk), and by the reasoning from earlier, this means the sum of the first ik integers in x (always ending with the kth 1) is equal to bk, which is positive because y is tame. Now consider the sum a1+a2++am for some an arbitrary m with 1m2n. If m=ik for some k, then the sum is positive by the reasoning just given. Otherwise, there is some k for which ik<m<ik+1. Since every integer in x strictly between aik and aik+1 equals 1 by construction, we must have that a1+a2++ama1+a2++am+am+1++aik+11 because the latter is obtained from the former by adding some (possibly zero) 1’s. We know that aik+1=1 and that a1+a2++am+am+1++aik+11+aik+1 is positive, so this means a1+a2++am0.

We have shown that x satisfies P2 as well, so x is a jagged sequence with f(x)=y. Therefore, f is surjective, which completes the proof that it is bijective. Therefore, the number of tame sequences of length n is 1n+1(2nn). ◻

Additional Information

Splendid sequences are part of a much more general curious combinatorial context. Here are a few definitions:

  1. A graph is a collection of vertices (denoted in this document by circles) and edges (lines connecting some of these circles).

  2. Two vertices in a graph connected by an edge are called adjacent.

  3. A splendid numbering of a graph is an assignment of a positive integer to each vertex so that

Below are some examples of splendid numberings of some graphs:

Five vertices are connected by five edges forming a pentagon. Moving clockwise around the pentagon, the vertices are numbered 1, 2, 1, 2, and 3. A sixth edge connects the two vertices labelled 1. A vertex numbered 6 is connected by three edges to three other vertices numbered 1, 2, and 3. Five vertices in a row with each vertex connected to the next by an edge. In order, the vertices are numbered, 1, 1, 1, 2, and 1.

You may notice that a splendid sequence of length n is simply a splendid numbering of the graph that is a path of length n (the rightmost example above is a path of length 5).

So, given a graph, we can ask the same question as in the problem of the month: How many splendid numberings are there? Just like splendid sequences, the number of splendid numberings for any fixed graph is finite! (see part (e) of the problem).

The exact number of splendid numberings is known for paths of length n. This was essentially the content of part (f) of the problem.

Two other families of graph for which splendid numbers have been studied are n cycles and n-pointed stars. Rather than defining these generally, the image below has a 6 cycle on the left and a 6 pointed star on the right. We leave it to the reader to guess the general definition.

On the left, six vertices arranged in a circle are connected by six edges forming a hexagon. On the right, one vertex in the centre is connected by six edges to six vertices placed around it.

A 6 cycle (left) and a 6-pointed star (right)

The number of splendid numberings of an n cycle is known to be (2n1n1). This was computed in a paper from 2018 (see reference (1)), which is quite recent!

For an n-pointed star, the number of splendid numberings is closely related to the number of ways to decompose the number 1 as a sum of the form 1=1k1+1k2++1kn where each ki is a positive integer, which is a very hard problem. In fact, it is currently unknown how many splendid numberings there are for the 9-pointed star.

This is almost all of what is known at the moment, and counting the number of splendid numberings (called arithmetical structures in the research community) is an active area of research. In 2020, for example, the number of splendid numberings for a particular family of graphs called "bidents" was computed (see reference (2)). It created a new entry in The On-Line Encyclopedia of Integer Sequences (OEIS)! The new entry is entry number A335676. If you’ve never played around with the OEIS, it’s definitely worth it. Just make sure you have a few procrastination hours to burn.

As a final note, we should mention that there are many resources out there about Catalan numbers. For example, Richard P. Stanley’s 2015 book "Catalan Numbers" contains a very long list of contexts where the Catalan numbers arise.

References

  1. Benjamin Braun et al. "Counting arithmetical structures on paths and cycles". In: Discrete Math. 341.10 (2018), pp. 2949-2963.

  2. Kassie Archer et al. "Arithmetical structures on bidents". In: Discrete Math. 343.7 (2020), pp. 111850, 23.

Problem 6: March 2023

Problem

For a non-negative integer n, define f(n) to be the first digit after the decimal point in the decimal expansion of n. For example, 10=3.162277 and so f(10)=1. Note that f(0)=0 and that f(n)=0 when n is a perfect square. You will likely want a calculator that can compute square roots for this question.

  1. Compute f(n) for every integer n strictly between 1 and 4 as well as every integer n strictly between 36 and 49.

  2. Compute f(n) for every integer n strictly between 4 and 9 as well as every integer n strictly between 49 and 64.

  3. Show that if n is a positive multiple of 5, then each digit from 0 through 9 appears in the list f(n2+1),f(n2+2),f(n2+3),,f(n2+2n1),f(n2+2n) the same number of times.

  4. For each digit d from 0 through 9, determine how many times d occurs in the list f(1),f(2),f(3),,f(104)

  5. Here are a couple of other things that you might like to think about. No solution will be provided for either of these questions, but as always, we would love to hear about any observations you make!

Hint

  1. There is no hint given for this part, but it might be useful in later parts to see if you notice any patterns in the distribution of the possible outputs of the function f.

  2. See part (a).

  3. If n2<m<(n+1)2, then f(m)=d is equivalent to n+d10<m<n+d+110.

  4. Similar to the result in (c), if n is one more than a multiple of 5, then in the list f(n2+1),f(n2+2),,f(n2+2n) every possible value from 0 through 9 appears exactly n15 times, with the exception of 4 and 7 which appear n15+1 times each. Try to find and prove other similar results.

Solution

Note: In this solution, we will take for granted that if n is a positive integer that is not a perfect square, then n is an irrational number.

  1. Since 21.4142 and 31.7320, we have that f(2)=4 and f(3)=7.

    In the table below, the first column contains the integers n from 37 through 48, the second column contains n truncated to four digits past the decimal point, and the third column contains f(n).

    n n f(n)
    37 6.0827 0
    38 6.1644 1
    39 6.2449 2
    40 6.3245 3
    41 6.4031 4
    42 6.4807 4
    43 6.5574 5
    44 6.6332 6
    45 6.7082 7
    46 6.7823 7
    47 6.8556 8
    48 6.9282 9

    Among the values of f(n) for n from 37 through 48, each integer from 0 through 9 appears exactly once except for 4 and 7, which appear exactly twice each. Notice that 4 and 7 are the values of f(2) and f(3), respectively.

  2. Since 52.2360, 62.4494, 72.6457, and 82.8284, we have that f(5)=2, f(6)=4, f(7)=6, and f(8)=8.

    In the table below, the first column contains the integers n from 50 through 63, the second column contains n truncated to four digits past the decimal point, and the third column contains f(n).

    n n f(n)
    50 7.0710 0
    51 7.1414 1
    52 7.2111 2
    53 7.2801 2
    54 7.3484 3
    55 7.4161 4
    56 7.4833 4
    57 7.5498 5
    58 7.6157 6
    59 7.6811 6
    60 7.7459 7
    61 7.8102 8
    62 7.8740 8
    63 7.9372 9

    Similar to part (a), observe that among the values of f(n) for n between 50 and 63 inclusive, every integer from 0 through 9 appears either once or twice, and the integers that appear twice are exactly f(5)=2, f(6)=4, f(7)=6, and f(8)=8.

  3. Suppose m is a positive integer in the list n2+1,n2+2,,n2+2n. This is equivalent to n2<m<(n+1)2, which is equivalent to n<m<n+1 since m, n, and n+1 are non-negative.

    Fix an integer d satisfying 0d9 and assume that m is an integer satisfying both n2<m<(n+1)2 and f(m)=d. That f(m)=d means d is the first digit past the decimal point in the decimal expansion of m. That m is between n and n+1 means the integer part of m is n. Therefore, m is at least d10 more than n and at most d+110 more than n. Since m is between two consecutive perfect squares, it is not a perfect square, which means m is irrational. Putting this together, we get that n+d10<m<n+d+110 where the strict inequalities are justified by the irrationality of m. We are also assuming that n is a positive multiple of 5, which means there is some positive integer k such that n=5k.

    The quantities in the chain of inequalities above are all positive, which means (n+d10)2<m2<(n+d+110)2 Expanding and substituting n=5k, we get 25k2+dk+d2100<m<25k2+(d+1)k+(d+1)2100

    We will now count the number of integers that satisfy the inequalities above.

    Since the integer d satisfies 0d9, we must have that 0d2100<1. Therefore, 25k2+dk+d2100 is between the consecutive integers 25k2+dk and 25k2+dk+1, possibly equal to the smaller of the two but not equal to the larger of the two. Since m is an integer that is greater than 25k2+dk+d2100, we conclude that 25k2+dk+1m

    Similarly, 0d9 implies that 0<(d+1)21001. This means 25k2+(d+1)k+(d+1)2100 is between the consecutive integers 25k2+(d+1)k and 25k2+(d+1)k+1, possibly equal to the larger of the two but not equal to the smaller of the two. Since m is an integer that is smaller than 25k2+(d+1)k+(d+1)2100, we can conclude that m25k2+(d+1)k. Combining this inequality with the inequality from earlier, we now have that 25k2+dk+1m25k2+(d+1)k The number of integers m that satisfy this inequality is (25k2+(d+1)k)(25k2+dk)=k

    We have now shown the following: For each integer d satisfying 0d9, there are at most k integers m in the list n2+1,n2+2,,n2+2n with the property that f(m)=d. There are 2n integers in the list above and only ten different values that the function f can output. Since 10k=2n, there is no possibility other than that f takes every possible value exactly k=n5 times.

  4. To get an idea of how to proceed, we first discuss the results of parts (a), (b), and (c).

    In part (a), we saw that for values of m between 12 and 22, the function f takes on every possible value the same number of times (zero) with the exception of 4 and 7, which occur one extra time each. For values of m between 62 and 72, the function f takes on every possible value the same number of times (one) with the exception of 4 and 7, which occur one extra time each.

    Similarly, in part (b) we observed that f takes on every value the same number of times, with the exceptions of 2, 4, 6, and 8 when m ranges between 22 and 32 as well as between 72 and 82.

    The result of part (c) was that if n is a multiple of 5, then f(m) takes on every possible value the same number of times (with no exceptions) as m ranges over the integers strictly between n2 and (n+1)2.

    The patterns in part (a) and (b) continue, and there are similar patterns for other ranges between perfect squares. A bit more precisely, if n is a positive integer, then as m ranges over the integers between n2 and (n+1)2, f(m) takes on every possible value the same number of times, possibly with some exceptions that occur one extra time each. These exceptional values depend only on the remainder when n is divided by 5.

    Even more precisely, the following five claims are true. The claims are numbered to correspond to remainders after division by 5.

    In part (c), we showed that Claim 0 is true. Before proving Claims 1, 2, 3, and 4, we will answer the actual question which was to determine how many times each digit occurs in the list f(1),f(2),f(3),,f(104) Because 104 is a perfect square, f(0)=f(104)=0, so we can instead count the number of times each digit occurs in the slightly different list f(0),f(1),f(2),,f(1041)

    There are 100 perfect squares among the integers from 0 through 1041, so there are 100 occurrences of 0 in the list that come from perfect squares.

    For every other integer m in the list 0,1,2,3,4,,1041, there are unique integers k and r with 0k19 and 0r4 with the property that (5k+r)2<m<(5k+r+1)2.

    Suppose d is a non-zero digit. For fixed k and r, as we let m take the values strictly between (5k+r)2 and (5k+r+1)2, Claim r tells us whether the digit d occurs either k times or k+1 times in that range. We are considering values of m satisfying (5k+r)2<m<(5k+r+1)2 for every pair (k,r) with 0k19 and 0r4. For every pair of the form (k,0), we get k occurrences of d (see Claim 0). For every pair of the form (k,1), we always get k occurrences or we always get k+1 occurrences of d, depending on what Claim 1 says about the digit d. Continuing with this reasoning, the number of occurrences of d in the list f(0),f(1),f(2),,f(1041) can be expressed in the form a(0+1+2++18+19)+b(1+2+3++19+20)=190a+210b where a is the number of values of r for which Claims 0 through 4 say there are k occurrences of d, and b is the number of values of r for which Claims 0 through 4 say there are k+1 occurrences of d.

    For example, for d=1, there are k occurrences when r=0, r=1, and r=2, and there are k+1 occurrences when r=3 and r=4. Therefore, with d=1, we have a=3 and b=2, so the number of times that d=1 occurs in the list is 3×190+2×210=990.

    Using Claims 0 through 4, the table below summarizes the count for the remaining non-zero digits. In the first column, the digit d appears, in the second column the value of a appears, in the third column, the value of b occurs, and in the fourth column, 190a+210b appears, which is the number of times d appears in the list.

    d a b 190a+210b
    1 3 2 990
    2 3 2 990
    3 3 2 990
    4 1 4 1030
    5 4 1 970
    6 2 3 1010
    7 2 3 1010
    8 2 3 1010
    9 5 0 950

    Finally, for d=0, we already have 100 occurrences of 0 in the list coming from the perfect squares. Otherwise, we can use the exact same technique as above to count the number of 0s in the list coming from integers that are not perfect squares. For d=0, a=5 and b=0, so there are 5(190)+0(210)+100=1050 occurrences of the digit 0 in the list f(0),f(1),f(2),,f(1041).

    We will now prove Claims 1 through 4.

    Suppose k is a non-negative integer, r is 0, 1, 2, 3, or 4, and that d is a digit between 0 and 9 inclusive. We wish to count the number of integers m such that f(m)=d and (5k+r)2<m<(5k+r+1)2. Specifically, we want to show that this number is either k or k+1 depending on r and d in the way delineated in Claims 0 through 4.

    The condition (5k+r)2<m<(5k+r+1)2 is equivalent to 5k+r<m<5k+r+1, and this combined with f(m)=d (note that m is not a perfect square and that 5k+r and 5k+r+1 are consecutive integers) is equivalent to 5k+r+d10<m<5k+r+(d+1)10. Since everything is non-negative, everything can be squared to get the equivalent chain of inequalities (5k+r)2+2(5k+r)d10+d2100<m<(5k+r)2+2(5k+r)(d+1)10+(d+1)2100. After some expansion, we have (5k+r)2+kd+2rd10+d2100<m<(5k+r)2+kd+k+2r(d+1)10+(d+1)2100. We are interested in how many integers m satisfy the chain of inequalities above. Since (5k+r)2+kd is an integer, the number of integers m satisfying the inequalities above is the same as the number of integers m that satisfy 2rd10+d2100<m<k+2r(d+1)10+(d+1)2100 and after combining fractions on the left and right, we get ()20rd+d2100<m<k+20r(d+1)+(d+1)2100

    Suppose 20rd+d2100 and 20r(d+1)+(d+1)2100 are both strictly between 0 and 1. Then the integers m satisfying () are precisely the integers 1 through k. More generally, we will show that whether there are k or k+1 integers depends on whether or not the quantities 20rd+d2100 and 20r(d+1)+(d+1)2100 are between the same pair of consecutive integers.

    To give an idea of how the argument will proceed, consider the situation when r=1 and d=4. Then 20rd+d2100=96100, but 20r(d+1)+(d+1)2100=125100. Thus, () becomes 96100<m<k+125100 The integers m=1 through m=k+1 satisfy these inequalities, for a total of k+1 integers.

    Observe that 20r(d+1)+(d+1)210020rd+d2100=(20rd+20r+d2+2d+1)(20rd+d2)100=20r+2d+110020(4)+2(9)+1100(since r4d19)=99100 This means the difference between 20rd+d2100 and 20r(d+1)+(d+1)2100 is less than 1, which leads to the following two possibilities.

    Possibility 1: There is an integer a so that a20rd+d2100<20r(d+1)+(d+1)2100a+1 In this case, the integers satisfying () are a+1, a+2, a+3, and so on through a+k for a total of k integers.

    Possibility 2: There is some integer a with the property that a<20rd+d2100<a+1<20r(d+1)+(d+1)2100<a+2 In this case, the integers satisfying () are a+1 through a+1+k, for a total of k+1 integers.

    We have now shown that there will be k+1 integers satisfying () exactly when there is an integer strictly between 20rd+d2100 and 20r(d+1)+(d+1)2100. Multiplying through by 100, this is equivalent to there being a multiple of 100 strictly between 20rd+d2 and 20r(d+1)+(d+1)2

    The table below contains the values of 20rd+d2 for every 0r4 and 0d9. The columns after the first are indexed by a value of d from 0 through 9 from left to right and the rows after the first are indexed by values of r from 0 through 4 from top to bottom. The cell in the row corresponding to r and the column corresponding to d contains 20rd+d2. Cells are highlighted if there is a multiple of 100 between the value in the cell and the value in the cell immediately to its right.

    r/d 0 1 2 3 4 5 6 7 8 9 10
    0 0 1 4 9 16 25 36 49 64 81 100
    1 0 21 44 69 96 125 156 189 224 261 300
    2 0 41 84 129 176 225 276 329 384 441 500
    3 0 61 124 189 256 325 396 469 544 621 700
    4 0 81 164 249 336 425 516 609 704 801 900

    The highlighted cells correspond to pairs (r,d) for which 20rd+d2 is less than a multiple of 100 and 20r(d+1)+(d+1)2 is greater than that multiple of 100. As noted above, these correspond to the pairs (r,d) for which k+1 integers satisfy (). For r=0, we see no values of d, which gives another proof of Claim 0. For r=1, the values of d for which there are k+1 integers are d=4 and d=7, which proves Claim 1. Continuing, the data in the table above verifies Claims 0 through 4.

Problem 7: April 2023

Problem

Let An denote the set of all n-tuples of 0s and 1s. For example, A2 is the set of all ordered pairs of 0s and 1s or A2={(0,0),(0,1),(1,0),(1,1)}. To improve readability, we will omit the commas and parentheses from the elements of An. For example, the elements of A3 will be denoted by 000, 001, 010, 011, 100, 101, 110, and 111.

Variables referring to elements of An will be bold lowercase letters. For example, we might refer to elements in A2 as a, or b, and so on. To refer to the coordinates of elements in An, we will use square brackets. For example, if a=11010, an element in A5, then a[1]=1, a[2]=1, a[3]=0, a[4]=1, and a[5]=0.

For two elements a and b in An, the Hamming distance, denoted d(a,b) between a and b is equal to the number of coordinates where they differ. For example, if a=11010 and b=01110, then d(a,b)=2 because a[1]b[1] and a[3]b[3], but a[i]=b[i] for i=2, i=4, and i=5. It is important to convince yourself that d(a,b)=d(b,a) for any a and b.

The notion of a graph was defined in the extra information about the February 2023 problem, but there are also plenty of places online that have definitions. We will keep things simple here and define a graph to be a collection of vertices, some of which are connected to each other by edges. When we draw a graph, a vertex will be represented by a circle and an edge will be represented by a line segment from one vertex to another. Two examples of graphs are depicted below. The one on the left has four vertices and the one on the right has eight. Note that two edges intersecting does not necessarily imply the presence of a vertex.

Four vertices connected by four edges forming a square. Four vertices connected by four edges form a first square, and another four vertices connected by four edges form a second square. The second square is slightly offset from the first so the squares overlap in a smaller square area. Corresponding pairs of vertices of the two squares are connected by four additional edges.

For each n, we define a graph with 2n vertices called the natural graph of An. In the natural graph of An, it is possible to label every vertex by exactly one element of An such that there is an edge between two vertices exactly when their Hamming distance is 1. The two examples above are the natural graphs of A2 and A3. They are shown again below with their vertices labelled.

Starting at the bottom left corner and moving clockwise around the perimeter of the square, the vertices are labelled 0 0 then 0 1 then 1 1 then 1 0. In the first square, starting at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 0 0 then 0 0 1 then 1 0 1 then 1 0 0. In the second square, starting again at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 1 0 then 0 1 1 then 1 1 1 then 1 1 0.

A walk in a graph from vertex v to vertex w is a sequence of vertices starting at v and ending at w with the property that there is an edge connecting every pair of consecutive vertices in the sequence. The length of a walk is the number of edges it uses. For example, let v, w, x, and y be the vertices labelled by 000, 110, 100, and 010 in the natural graph of A3, respectively. Then v,x,w and v,y,w are walks of length 2 from v to w. The distance between v and w in a graph is equal to the shortest possible length of a walk from v to w. In the example above, v and w have a distance of 2 because there are walks of length 2, but there are no shorter walks from v to w.

  1. Let a and b be elements of An. Show that d(a,b) is equal to the distance between a and b in the natural graph of An.

  2. For each k with 1kn, determine the number of two-element subsets {a,b} of An that satisfy d(a,b)=k.

  3. Suppose we were to relabel the vertices of the natural graph of An by permuting the labels. That is, we keep the graph the same but use the elements of An to label a vertex of the graph in some other way. For example, in A2, we might leave 00 and 10 where they are and swap the positions of 01 and 11, as shown.

    First graph: Starting at the bottom left and moving clockwise, the vertices are labelled 0 0 then 0 1 then 1 1 then 1 0. Second graph: Starting at the bottom left and moving clockwise, the vertices are labelled 0 0 then 1 1 then 0 1 then 1 0.

    When this is done, the distance in the new graph between elements of a and b is not necessarily equal to d(a,b) any more. The table below has the two-element subsets of A2 in the first column, d(a,b) in the second column, and their distance in the relabelled graph in the third column.

    {a,b} d(a,b) new distance
    {00,01} 1 2
    {00,10} 1 1
    {00,11} 2 1
    {01,10} 2 1
    {01,11} 1 1
    {10,11} 1 2

    Among the four subsets {a,b} with d(a,b)=1, there are two that have a distance in the relabelled graph of 1 and two that have a distance in the relabelled graph of 2.

    Now for the question: For each n, find a way to permute the elements of An so that the following happens: Among all two-element subsets {a,b} of An with d(a,b)=1, there are the same number with each possible distance in the relabelled graph.

Hint

  1. Suppose d(a,b)=k for some k. Try to construct a path of length k in the natural graph from the vertex labelled a to the vertex labelled b.

  2. For fixed aAn, how many bAn have the property that d(a,b)=k?

  3. Find a function that works for n=2 and use this to build one for n=3. It might be useful to think of the natural graph of A2 as a square and the natural graph of A3 as a cube. As well, a cube can be thought of as two squares on top of each other with vertical edges connecting corresponding vertices in the top and bottom faces.

Solution

  1. Suppose a and b are elements in An and that d(a,b)=k for some k. If k=0, then a=b, so their distance in the graph is also 0.

    Otherwise, a and b differ at exactly k coordinates i1,i2,,ik where i1<i2<<ik. Using the notation introduced in the problem statement, we mean that a[i]b[i] if i is in the list i1,i2,,ik and a[i]=b[i] otherwise. Notice that the function g(x)=1x has the property that g(0)=1 and g(1)=0, so g switches 1 and 0. We will now define a sequence a1,a2,,ak of elements in An. Informally, a1 is obtained from a by leaving all coordinates alone except a[i1], which gets changed from 0 to 1 or 1 to 0 as appropriate. Continuing, a2 is obtained from a1 by leaving all coordinates alone except a1[i2], which gets switched, and this continues for a3, a4, and so on. More formally, for each m1 with 1mk we define am as follows.

    By construction, the list a,a1,a2,,ak1,ak is a list in which every pair of elements differ at exactly one coordinate. Moreover, the list is that which is generated by changing the coordinates of a that differ from those of b one at a time, from leftmost to rightmost. This means b=ak, and the above is a walk from a to b. There are k+1 vertices in this walk, so there are k edges.

    We have constructed a walk from a to b in the natural graph of An that has length k, which means the distance from a to b in the natural graph is at most k. To see that it is at least k, we suppose a,c1,c2,,cm1,b is a walk in the natural graph of An of length m for some m. Since there are m vertices in this walk in addition to a and two vertices have an edge between them exactly when they differ at exactly one coordinate, the total number of coordinates at which a and b (the ends of the walk) can differ is at most m. Since we know that they differ at exactly k coordinates, we must have that mk. This means that any walk from a to b in the natural graph of An has at least k edges.

    We have shown that the distance in the natural graph between a and b is at least k and at most k, which means it is exactly k.

  2. For convenience, in the solution to this part and the solution to part (c), we will refer to a two element subset as a pair. Since d(a,b)=d(b,a) for any elements a,bAn, we will say that d(a,b) is the Hamming distance of the pair {a,b} or the pair {a,b} has Hamming distance d(a,b), and possibly other similar things depending on the grammar in that particular sentence. Similarly, we might say that {a,b} has distance k in a graph to mean that the distance between the vertices labelled by a and b is k in that graph.

    For a fixed element aAn, an element bAn satisfies d(a,b)=k exactly when it differs from a at exactly k coordinates. There are n coordinates in total, so there are (nk) possible choices of k coordinates that could be different from a. Therefore, for a fixed element aAn, there are exactly (nk) elements bAn with the property that d(a,b)=k. There are 2n elements in An and each aA belongs to exactly (nk) pairs with a Hamming distance of k. This gives a total of 2n×(nk) pairs. However, this total

    counts every pair twice, once for each of its two elements. Thus, the number of pairs in An with a Hamming distance of k is 122n(nk)=2n1(nk).

  3. Denote by En the set of pairs {a,b} from An satisfying d(a,b)=1. From part (b), there are 2n1(n1)=n2n1 pairs in En. In the relabelled natural graph of An, we want the distances of the pairs in En to be equally distributed among all possible distances in the graph. There are n possible distances between distinct vertices in the graph, so the fact that n2n1 is a multiple of n is a good sign.

    We want to permute the elements of An in such a way that for each k from 1 through n, exactly n2n1n=2n1 pairs in En have a distance of k in the relabelled graph.

    There are many ways to do this. The approach given here is inductive, starting by examining A2. Consider the example from the problem statement. In that example, 01 and 11 were switched and 00 and 10 stayed the same.

    First graph: Starting at the bottom left corner of the square and moving clockwise around the perimeter, the vertices are labelled 0 0 then 0 1 then 1 1 then 1 0. Second graph: Starting at the bottom left and moving clockwise, the vertices are labelled 0 0 then 1 1 then 0 1 then 1 0.

    Although it is not very interesting in A2, there is an observation we can make that will generalize. The vertices that are connected by horizontal edges in the diagram of the natural graph of A2 remain connected by an edge after permuting. The vertices in the top change order but their distance apart does not change. Meanwhile, the vertices that are connected by a vertical edge are moved to occupy opposite corners of the square so their distance goes from 1 to 2. While this is only an increase of 1, it will be useful going forward to think of the vertices connected by vertical edges as having gone from as close together as possible (connected by an edge) to as far apart as possible.

    Now consider the natural graph of A3, which is pictured below.

    In the first square, starting at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 0 0 then 0 0 1 then 1 0 1 then 1 0 0. In the second square, starting again at the bottom left corner and moving clockwise around the perimeter, the vertices are labelled 0 1 0 then 0 1 1 then 1 1 1 then 1 1 0.

    There are 12 edges in the graph. After permuting the labels of the graph, we want 123=4 pairs of adjacent vertices to be sent to adjacent vertices, 4 pairs of adjacent vertices to be sent to vertices with a distance of 2, and 4 pairs of adjacent vertices to be sent to vertices with a distance of 3.

    Looking at the diagram, we can think of the natural graph of A3 as being composed of two copies of the natural graph of A2 laid horizontally on top of each other. The labelling also has some coherence with the labelling of A2. First, label the bottom and top square as if they were copies of the natural graph of A2, making sure to label vertically-adjacent vertices in the same way. Next, append a 0 to the right of every label in the bottom layer and append a 1 to the right of every label in the top layer.

    To permute the labels in the way we want, we will first perform the same permutation on each layer as we did in A2. In each layer, this moves two pairs of labels from adjacent vertices so that they are at a distance of 2. There are also two pairs of adjacent vertices in each layer that remain adjacent after permuting. The four pairs of vertically-adjacent vertices will remain vertically adjacent because we will have performed the exact same permutation in each layer. At this point, the labels on four pairs of adjacent vertices have been sent to vertices that are 2 apart and the other 8 pairs of labels remain on adjacent vertices. The diagram below shows what we have done so far:

    In the first square, starting at the bottom left and moving clockwise, the vertices are still labelled 0 0 0 then 0 0 1 then 1 0 1 then 1 0 0. In the second square, starting at the bottom left and moving clockwise, the vertices are now labelled 1 1 0 then 1 1 1 then 0 1 1 then 0 1 0.

    The second and final step is to swap the corners in the top layer. This will have the effect of moving the labels on vertically-adjacent vertices to be as far apart as possible. In a "cube", this means they will end up at opposite ends of a "space diagonal". Swapping the corners in a layer preserves the distance between all pairs of vertices in that layer. This means the net effect of the second step is to move four pairs of adjacent vertices so that they are at a distance of 3. The overall effect is shown below:

    In the first square, starting at the bottom left and moving clockwise, the vertices are now labelled 0 0 0 then 0 1 1 then 1 1 1 then 1 0 0. In the second square, starting at the bottom left and moving clockwise, the vertices are now labelled 1 1 0 then 1 0 1 then 0 0 1 then 0 1 0.

    In the table below, the first column has the 12 pairs from E3 and the second column has the distance of the corresponding pair in the relabelled graph.

    {a,b} new distance
    {000,001} 3
    {000,010} 2
    {000,100} 1
    {001,011} 2
    {001,101} 1
    {010,011} 3
    {010,110} 1
    {011,111} 1
    {100,101} 3
    {100,110} 2
    {101,111} 2
    {110,111} 3

    As n grows, the natural graph of An gets harder and harder to draw in a useful way, so we need some notation to help translate the geometric idea into symbols. First, we will clarify what we actually want.

    Suppose f is a function with domain An and codomain An. This means f is a function that takes elements of An as input and also outputs elements of An. When we talk about a permutation of An, we really mean a function f with domain and codomain both equal to An that is a bijection. For a brief discussion about what a bijection is, you can consult Appendix 1 from the solution to the February 2023 problem. In the context of this solution, a function from An to An is a permutation if every possible output is attained by exactly one input. For example, the function f with domain and codomain A2 given by f(00)=11f(01)=01f(10)=00f(11)=10 is a bijection from A2 to A2. Every possible output is attained (the four elements of A2 appear on the right side of the displayed equations above) and no output is attained more than once. If you think about it, every way to order the elements of A2 (a permutation) corresponds to exactly one such function: choose an order of the elements, then write them in that order in the second column above. It will not be important for this solution, but it might help you to understand this connection if you convince yourself that there are exactly 4!=24 bijections from A2 to itself.

    A rearrangement of the labels in the natural graph of An can be thought of as a bijection from An to itself. If f is such a function, then f(a) is equal to the original label of the vertex to which the label a is sent by the permutation. For example, the permutation for A3 corresponding to the relabelling from earlier (shown below)

    is given by f(000)=000f(001)=111f(010)=110f(011)=001f(100)=100f(101)=011f(110)=010f(111)=101 For example, the fourth of the displayed equations above is f(011)=001 because in the second diagram 011 appears where 001 originally appeared.

    This is an important observation because we can now recognize distance in the relabelled graph as a Hamming distance. The distance between a and b in the relabelled graph is equal to the distance between f(a) and f(b) in the original graph. By part (a), this means the distance between a and b in the relabelled graph is equal to d(f(a),f(b)).

    We can now formally articulate what we seek. For each n, we would like a function fn with domain and codomain both equal to An with the following properties.

    It may be a good idea to digest what has been said so far, possibly going back to see how this applies to A2 and A3.

    We can now define fn for each n, but the definition will be recursive, so we need a bit more notation. For an element a in An where n1, we will write a|0 to mean the element of An+1 that is obtained by appending a 0 to the right end of a. For example, 00110|0=001100. Similarly, a|1 is the element of An+1 obtained by appending 1 to the right end of a. Also, we will denote by a the element of An obtained by changing every coordinate of a from 0 to 1 or 1 to 0, as appropriate. For example, if a=0010111, then a=1101000.

    Starting with n=1 (which we have not addressed up to this point) we will let f1(a)=a. That is, f1(a) is the identity function. The elements of A1 are 0 and 1, and f1(0)=0 and f1(1)=1. We now continue recursively. For n1, we define fn+1 from fn as follows.

    Notice that the above instructions indeed explain how to evaluate fn+1 at every element of An+1 because each element of An+1 can be constructed in exactly one way by appending either a 0 or a 1 to the right of an element from An. As an example, we will determine exactly what f2 does to each element in A2. For 00, we have to use the rule in the first bullet point because the rightmost digit is 0. f1(0)=0, so we have that f2(00)=00. Since the second digit of 10 is also 0 and f1(1)=1, we get that f2(10)=10. For 01, we have to use the rule in the second bullet point. This means f2(01)=f1(0)|1=0|1=11. Finally, f2(11)=f1(1)|1=1|1=01. This is exactly the function from A2 to itself discussed earlier. We leave it as an exercise to verify that f3 is exactly the permutation of A3 discussed earlier.

    We can now prove by induction that fn does what we want for every n. Before doing that, we will discuss how this function corresponds to the geometric idea from earlier. The elements in An+1 can be obtained by taking each element of An and appending a 0 to the right and a 1 to the right, in a way getting two elements in An+1 from every element in An. By this reasoning, An+1 can be thought of as two copies of An: elements ending in 0 and elements ending in 1. If you look at the natural graph of A3 above, these two copies are exactly the "bottom" and the "top" squares. The way fn+1 is defined is to operate differently on the two copies of An, since how fn+1(a) is computed depends on the rightmost digit of a. In other words, it depends on which copy of An a belongs to. If a has a rightmost digit of 0, then fn+1 essentially does what fn did. This corresponds to the bottom face of the cube being permuted exactly as the square was. If the rightmost digit of a is 1, then a is in the other copy, corresponding to the top face of the cube in the case of A3. In this situation, we apply fn to the element of An obtained by removing the last digit, just as we would if the rightmost digit were 0. However, we then switch every digit, and this corresponds to "swapping the diagonals" in A3. Finally, a 1 is appended to the right of the result, which corresponds to making sure that elements in the top of the cube stay in the top of the cube during the permutation.

    For n=1, it is an exercise in understanding definitions to see that fn satisfies the given conditions. We have already established this for n=2, and n=3 can be verified by confirming that f3 is exactly the permutation from earlier that we verified worked.

    We now assume, for some n1, that fn is a permutation of An with the property that among pairs {a,b} from En, d(fn(a),fn(b)) takes on every value from 1 through n exactly 2n1 times. We will show that fn+1 is a permutation of An+1 with the property that among pairs {a,b} from En+1, d(fn+1(a),fn+1(b)) takes on every value from 1 through n+1 exactly 2n times.

    To see that fn+1 is a permutation, let aAn be arbitrary. Since fn is a permutation, there is a unique element bAn such that fn(b)=a and a unique element cAn such that fn(c)=a. Using the definition of fn+1, we have fn+1(b|0)=fn(b)|0=a|0 and fn+1(c|1)=fn(c)|1=a|1=a|1. Since every element in An+1 is of the form a|0 or a|1 for some aAn, we have shown that every element of An+1 is in the range of fn+1. Now suppose a1,a2,a3,,a2n+1 are the elements of An+1 (in some order). We have shown that every element of An+1 appears in the list fn+1(a1),fn+1(a2),,fn+1(a2n+1) at least once. There are 2n+1 elements in the list above and 2n+1 elements in An+1, so every element of An+1 must appear in the list above exactly once. In other words, fn+1 is a permutation of An+1.

    To prove the other fact about fn+1, we will use the fact that d(a,b)=d(a,b) for any a and b. It is left as an exercise to verify this.

    Suppose k is a positive integer such that 1kn. By induction, there are exactly 2n1 pairs {a,b} in En with d(fn(a),fn(b))=k. If {a,b} is one of these 2n1 pairs, we have d(fn+1(a|0),fn+1(b|0))=d(fn(a)|0,fn(b)|0)=d(fn(a),fn(b))=k where the second equality is because the elements in question agree in the last coordinate, so their Hamming distance is equal to the Hamming distance between the elements obtained by removing the rightmost elements. We similarly have that d(fn+1(a|1),fn+1(b|1))=d(fn(a)|1,fn(b)|1)=d(fn(a),fn(b))=d(fn(a),fn(b))=k Therefore, there are 2×2n1=2n pairs {a,b} from En+1 satisfying d(fn+1(a),fn+1(b))=k for each 1kn.

    Next, for any aAn, we have d(fn+1(a|0),fn+1(a|1))=d(fn(a)|0,fn(a)|1)=d(fn(a),fn(a))+1=n+1 where the second equality is because we know that the two elements being handed to d have different rightmost coordinates, so their Hamming distance is one more than the Hamming distance between the elements obtained by removing the rightmost coordinates. The third equality is because fn(a) and fn(a) differ in all n coordinates by definition.

    There are 2n elements of An, and each pair {a|0,a|1} is in En+1, so we get 2n pairs from En+1 such that d(fn+1(a),fn+1(b))=n+1. For each k from 1 through n+1, we have found 2n pairs {a,b} from En+1 with the property that d(fn+1(a),fn+1(b))=k. This completes the proof.

Problem 8: May 2023

Problem

This month’s problem is based on Problem 6 part (b) of the 2023 Euclid Contest. Here is a modified and rephrased version of that problem:

A square is drawn in the plane with vertices at (0,0),(1,0),(1,1), and (0,1). Two blue lines are drawn with slope 3, one passing through (0,0) and the other through (13,0). Two red lines are drawn with slope 13, one passing through (0,1) and the other through (0,23). What is the area of the square bounded by the red and blue lines?

The answer to this question is 110. We suggest convincing yourself of this before attempting the rest of the problem. The fact that this small square has an area exactly one tenth of the larger square suggests that there is a way to answer this question by showing that exactly 10 squares the size of the small one should fit into the large square. Let’s explore!

Here is some terminology that we will use in this problem.

Definition: A lattice point is a point (x,y) for which x and y are both integers.

Definition: A 1×1 square whose vertices are at lattice points is called a unit lattice square. We will denote by T the unit lattice square with vertices (0,0), (1,0), (1,1), and (0,1).

Definition: Lq,p denotes the line segment connecting (0,0) to the point (q,p). Note that this line has slope pq.

Definition: An m – lattice line is a line with slope m that passes through at least one lattice point.

The next two definitions are more complicated. There are examples given after they are stated.

Definition: The tricky unit square, T, is a modified version of T (see above) with the property that if a line reaches an edge of T, it "jumps" to the opposite side and continues with the same slope. For example, if a line reaches the top edge of T, it continues with the same slope from the bottom edge directly below where it reached the top edge. If a line reaches a vertex of T, then it has simultaneously reached two edges. In this situation, it continues with the same slope from the opposite vertex of T.

Definition: Let pq be a rational number written in lowest terms. The pq – loop on T is the line passing through (0,0) with slope pq.

Below are diagrams, from left to right, of the 12 – loop, the 21 – loop, and the 25 – loop on T. In each diagram, equal letters mark places where the line jumps from one side of the square to the opposite side.

In a square, a line goes from the bottom left vertex, labelled a, to the midpoint of the right side, labelled b. Another line goes from the midpoint of the left side, labelled b, to the top right vertex, labelled a. In another square, line goes from the top left vertex, labelled a, to the midpoint of the bottom side, labelled b. Another line goes from the midpoint of the top side, labelled b, to the bottom right vertex, labelled a. In a third square, there are six lines: 
bottom left vertex, a, to two-fifths up right side, b; 
two-fifths up left side, b, to four-fifths up right side, c; 
four-fifths up left side, c, to midpoint of top side, d; 
midpoint of bottom side, d, to one-fifth up right side, e; 
one-fifth up left side, e, to three-fifths up right side, f; 
three-fifths up left side, f, to top right vertex, a.

Each of the loops above eventually come back to their starting point and repeat. This happens because pq is rational (think about this!). Notice that in the image of the 21 – loop (the middle image), the loop starts at (0,1) instead of (0,0). This is because a line of negative slope starting at (0,0) (on the bottom edge) immediately jumps to the top edge and continues from (0,1). It is worth thinking about how all four vertices of T really represent the same point.

Below is an image of T with the 31 – loop in blue and the 13 – loop in red. These two loops divide T into 10 smaller squares. The squares numbered 1, 2, 3, 4, 5, and 6 are split in two pieces each across edges of T. Notice that both the loops pass thorough the point (0,0) since the four vertices of the square are the same point. This means, if we count the four vertices as one intersection point, the two loops intersect exactly 10 times (count them!). Think about how this compares to the Euclid problem mentioned earlier.

A description of the diagram follows.

  1. For each pair of loops below, draw T with that pair of loops, count the number of times the loops intersect, and count the number of squares into which the loops divide T.

    1. The 41 – loop and the 14 – loop.

    2. The 23 – loop and the 32 – loop.

    3. The 43 – loop and the 34 – loop.

    4. The 11 – loop and the 11 – loop.

In the remaining problems, p and q are positive integers that have no positive divisors in common other than 1.

  1. How many line segments make up the pq – loop?

  2. How many pq – lattice lines intersect T?

  3. Explain why the number of points of intersection of the pq – loop and the qp – loop on T is equal to the number of small squares into which the loops divide T. Remember that the four vertices of T represent the same point.

  4. How many qp – lattice lines intersect Lq,p?

  5. Compute the area of the small squares in T created by the pq – loop and the qp – loop. Our solution will take for granted that these small squares all have the same area, but you might like to think about how to prove this.

Hint

  1. When counting, remember that some squares are split into pieces. As well, the four vertices of T count together as one intersection point.

  2. Relate the number of segments to the number of unit lattice squares through which Lq,p passes.

  3. Such a line has an equation of the form y=pqx+b. What can you say about f(0) and f(1) based on the fact that the line intersects T? do not forget about the condition that the line must pass through at least one lattice point!

  4. Each square has a leftmost vertex.

  5. Similar to the hint for part (c), such a line must have equation y=qpx+b. Try to deduce restrictions on the value of b from the fact that this line intersects Lq,p.

  6. Since the squares have the same size (though some might be broken into pieces) and T has area 1, the area of the squares can be computed by computing the number of them. Our solution will put together the ideas from (b) through (e) to count the squares. Specifically, the count in part (e) can be related to the number of squares. Remember to be careful with the four corners of T, which count as one point.

Solution

The following fact will come in handy later in the solution.

Fact 1: Let p and q be integers with q0 such that p and q have no positive divisors in common other than 1. If A and B are distinct lattice points such that the line segment joining them has slope pq, then the distance between A and B is at least p2+q2.

Proof of Fact 1. Suppose A is the point (a,b) and B is the point (a+s,b+t) where a, b, s, and t are integers so that the line segment joining A and B has slope pq. Then the line segment joining A and B has slope ts=pq. By the assumption on p and q, the fraction pq is written in lowest terms, so we must have |t||p| and |s||q| implying t2p2 and s2q2. The distance between A and B is t2+s2p2+q2, which completes the proof. ◻

    1. Below is a picture of the 41 – loop (in blue) and the 14 – loop (in red) on T.

      A square divided by 4 parallel blue lines with slope 4 and 4 parallel red lines with slope negative one-quarter. The blue lines start at the bottom left vertex and at points one, two, and three quarters along the bottom side. The red lines start at the top left vertex and at points one, two and three quarters down the left side.

      There are 17 intersection points. Remember that the two loops intersect at (0,0), which is the same point as the other three vertices of T.

      There are 17 small squares. Of these 17, 9 are whole squares in the middle of T, 4 are split into two pieces over the horizontal edges of T, and 4 are split over the vertical edges of T.

    2. Here is a picture of a 23 – loop (in blue) and a 32 – loop (in red) on T.

      A square divided by 4 blue lines with slope two-thirds and 4 red lines with slope negative three-halves. The blue lines start at the bottom left vertex, at points one and two thirds up the left side, and at the midpoint of the bottom side. The red lines start at the top left vertex, at points one and two thirds along the top side, and at the midpoint of the left side.

      There are 13 intersection points and 13 small squares.

    3. Here is a picture of a 43 – loop (in blue) and a 34 – loop (in red) on T.

      A square divided by 6 blue lines with slope four-thirds and 6 red lines with slope negative three-quarters. The blue lines start at the bottom left vertex, at one, two, and three quarters along the bottom side, and at one and two thirds up the left side. The red lines start at the top left vertex, at one, two, and three quarters down the left side, and at one and two thirds along the top side.

      There are 25 intersection points and 25 small squares.

    4. Here is a picture of a 11 – loop (in blue) and a 11 – loop (in red) on T.

      A square divided by its diagonals: a red line from the top left vertex to the bottom right vertex and a blue line from the bottom left vertex to the top right vertex.

      There are 2 intersection points and 2 small squares. Here the squares are harder to see, since both of them pass through the edges of T, passing over to the other side.

      It is not a coincidence that the number of small squares is equal to the number of intersection points in all four cases.

  1. Consider the line of slope pq through the origin. By Fact 1, (q,p) is the lattice point in the first quadrant that is closest to the origin. Therefore, there are no lattice points on Lq,p other than its endpoints. To illustrate the idea in this solution, the diagram below shows L5,11 along with every unit lattice square through which it passes.

    The line segment between (0,0) and (5,11) passes through fifteen unit lattice squares but does not pass through any of their vertices other than at the end points.

    The 115 – loop continues to wrap around T until it reaches a corner again. Because of how T behaves, we can think of the 115 – loop as the result of overlaying all of the unit lattice squares in the diagram above on top of each other. Indeed, if the blue line reaches the top of the square, it jumps to the bottom with the same x-coordinate and continues with the same slope. This means that after it jumps, what the line does in T is the same as what it does as it continues into the adjacent unit lattice square.

    This is true in general. So the number of line segments in the pq – loop is equal to the number of unit lattice squares that Lq,p intersects. By "intersects" we mean that the line passes through some part of the interior of the square and not just a vertex.

    Therefore, to count the line segments in the pq – loop, we can count the unit lattice squares through which Lq,p passes. Line segment Lq,p begins in T and passes into a new unit lattice square exactly when it crosses either a vertical line with equation x=a for some integer a or a horizontal line with equation y=b for some integer b. Since Lq,p passes through no lattice points other than its endpoints, it will never cross such a vertical and a horizontal line at the same time. Since Lq,p starts at (0,0) and ends at (q,p), it must cross q1 such vertical lines and p1 such horizontal lines. Adding one to account for the unit square from which it originates, this means there are (p1)+(q1)+1=p+q1 line segments in the pq – loop. For the 115 – loop, this gives 11+51=15 line segments. By counting, you can verify that there are indeed 15 unit lattice squares in the diagram above. If you carefully draw the 115 – loop, you will see that there are 15 segments.

  2. Since p and q are positive, pq is positive. Suppose f(x)=pqx+b is a pq – lattice line that intersects T. Then we must have b1, otherwise T would be entirely below the graph of f(x) (remember, its slope is positive). Additionally, we must have that f(1)0, otherwise T would be completely above the graph of f(x).

    The inequality f(1)0 is equivalent to pq+b0, or pqb. Combining with b1, we get pqb1, which we will write as pqbqq.

    So far, we have not used the fact that f(x) contains at least one lattice point. Suppose f(x) passes through some lattice point (u,v). That is, u and v are integers and f(u)=v. Then v=upq+b which can be rearranged to get b=vqupq. This implies that there is some integer a for which b=aq. Substituting into pqbqq, we get pqaqqq which is equivalent to paq. There are exactly p+q+1 integers a that satisfy these inequalities, so there are p+q+1 pq – lattice lines that intersect through T.

    Before moving on, we make the observation that two of the pq – lattice lines that intersect T only pass through the vertices (0,1) and (1,0). This means there are actually p+q1 pq – lattice lines that pass through the interior of T.

  3. Since p0 and q0, the loops are neither horizontal nor vertical. Therefore each of the small squares has a unique left-most vertex, which is the vertex with the smallest x-coordinate. Each of the small squares has exactly one left-most vertex, and every point of intersection is the left-most vertex of exactly one square. This means that the number of intersection points is equal to the number of squares.

    Note that this lends some credibility to counting the four vertices as one intersection point. See, for example, the 31 and 13 loops from the problem statement. In that example, the square labelled by 1 is split into two pieces, and its leftmost vertex is represented by all four vertices of T. It might be useful to think about this for a moment before moving on.

  4. Since p and q are positive, qp is negative. Suppose f(x)=qpx+b is a qp – lattice line that intersects Lq,p. Since the slope of f(x) is negative, we must have b0. Otherwise, Lq,p would be entirely above the graph of f(x).

    For similar reasoning, we also require that f(q)p, which means q2p+bp. This can be rearranged to bp2+q2p. Combining with b0 gives 0bp2+q2p. By essentially the same argument that was used in the solution to part (c), b must take the form ap for some integer a. Therefore, we have 0papp2+q2q and there are exactly p2+q2+1 integers a with this property. These lines are all different and all intersect Lq,p, so the answer is p2+q2+1.

    Before moving on, we note that the lines of slope qp that pass through (0,0) and (q,p) are qp – lattice lines that intersect Lq,p. Therefore, there are p2+q2+12=p2+q21 points of intersection of qp – lattice lines with Lq,p, excluding the endpoints. We will refer to this set of p2+q21 points several times in the solution to part (f), so we will denote it by X for convenience.

  5. Let Y be the set of intersection points of the pq – loop with the qp – loop, other than the point represented by the four corners of T. We will show that every point in X corresponds to exactly one point in Y, thereby showing that X and Y have the same number of elements. Since there are p2+q21 points in X, if we include the point in T represented by the corners, this will show that the loops have exactly p2+q2 intersection points in T. By part (d), this will show that the loops divide T into p2+q2 small squares.

    The rest of the solution is devoted to showing that X and Y have the same number of elements. We will use the following fact several times. Its proof is not included.

    Fact 2: If an m – lattice line is translated a units to the left and b units to the right for some integers a and b, then the line obtained is also an m – lattice line.

    We first observe that every line segment in the pq – loop is part of some pq – lattice line. To see why this is true, consider the solution to part (c). It was discussed there that the line segments of the pq – loop can be obtained by overlaying on T the unit lattice squares through which Lq,p passes. For each such unit lattice square, there are integers a and b so that the square can be translated a units to the left and b units down in order to land on T. Therefore, if we translate Lq,p a units to the left and b units down, it will land exactly on the segment of the pq – loop in question. Lq,p is part of a pq – lattice line, so by Fact 2 above, we have shown that every line segment in the pq – loop is part of some pq – lattice line.

    By part (b), there are p+q1 segments in the pq – loop. By the remark at the end of the solution to part (c), there are p+q1 pq – lattice lines that pass through the interior of T. Each of the segments in the pq – loop is in the interior of the square. We conclude that the segments of the pq – loop are exactly the parts of pq – lattice lines that pass through the interior of T.

    By very similar reasoning, we can also conclude that the qp – loop is made precisely of the segments of qp – lattice lines that pass through the interior of T.

    Consider a point (u,v) in X and suppose it is inside the unit lattice square with vertices (a,b), (a+1,b), (a+1,b+1), and (a,b+1). Let f(x) be the qp – lattice line that intersects Lq,p at (u,v). The point (ua,vb) is in T. If we translate f(x) and Lq,p to the left by a units and down by b units, the resulting lines will intersect at (ua,vb). By Fact 2, translating f(x) in this way results in a qp – lattice line and translating Lq,p results in a pq – lattice line. By the previous argument, these will be segments of the qp and pq loops, respectively. Therefore, (ua,vb) is a point of intersection of the two loops. This gives a natural way to translate points of X to points in Y. In symbols, we send (u,v) to (uu,vv).

    Suppose that (u,v) and (x,y) are two different points in X. If these points are in different unit lattice squares, then when they are translated to T, they will end up on different line segments of the pq – loop, so they cannot possibly be translated to the same point in Y. If they are in the same unit lattice square, then they will be translated to the left and down by exactly the same amount, so they will end up in different places in T. Either way, we can conclude that different points in X are sent to different points in Y by the rule described in the previous paragraph.

    Suppose (u,v) is a point in Y. This point is on some line segment of the pq – loop, and we have argued earlier that these segments come from translating unit lattice squares through which Lq,p passes (and taking the parts of Lq,p along for the ride). Suppose the segment on which (u,v) lies comes from the unit lattice square with vertices (a,b), (a+1,b), (a+1,b+1), and (a,b+1) and call this square S. The point (a+u,b+v) is in S and lies on Lq,p.

    We showed earlier that every line segment on the qp – loop is part of some qp – lattice line. Let f(x) be the qp – lattice line on which (u,v) lies. If we translate f(x) to the right by a units and up by b units, the result will be a new qp – lattice line by Fact 2. Moreover, this line will pass through (u+a,v+b), which also lies on Lq,p. Therefore, (u+a,v+b) is a point in X that is inside the square S. If we translate (u+a,v+b) to the left by a and down by b, it will be sent to (u,v) by construction.

    We have shown that each of the p2+q21 points in X corresponds to exactly one point in Y. As explained earlier, if we consider the four corners of T as one intersection point, then we get a total of p2+q2 intersection points of the two loops.

    As mentioned in the problem, we are taking for granted that the squares all have the same size. This means that each of them has an area of exactly 1p2+q2. Referring back to the Euclid problem from the beginning, we were dealing with the situation where p=3 and q=1, so the area of the squares is 132+12=110.