{
  "index": "1992-A-5",
  "type": "COMB",
  "tag": [
    "COMB",
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "number of 1's in the binary representation of $n$ is even (or odd),\nrespectively. Show that there do not exist positive integers $k$ and $m$\nsuch that\n\\[\na_{k+j} = a_{k+m+j} = a_{k+2m+j},\n\\]\nfor $0 \\leq j \\leq m-1$.",
  "solution": "Solution 1. The sequence begins\n\\( 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, \\ldots \\).\nThe problem is to show that there are not \"three identical blocks in a row\".\nThe definition of \\( a_{n} \\) implies that \\( a_{2 n}=a_{n}=1-a_{2 n+1} \\).\nSuppose that there exist \\( k, m \\) as in the problem; we may assume that \\( m \\) is minimal for such examples.\n\nSuppose first that \\( m \\) is odd. We'll suppose \\( a_{k}=a_{k+m}=a_{k+2 m}=0 \\); the case \\( a_{k}=1 \\) can be treated similarly. Since either \\( k \\) or \\( k+m \\) is even, \\( a_{k+1}=a_{k+m+1}=a_{k+2 m+1}= \\) 1. Again, since either \\( k+1 \\) or \\( k+m+1 \\) is even, \\( a_{k+2}=a_{k+m+2}=a_{k+m+2}=0 \\). By this means, we see that the terms \\( a_{k}, a_{k+1}, \\ldots, a_{k+m-1} \\) alternate between 0 and 1 . Then since \\( m-1 \\) is even, \\( a_{k+m-1}=a_{k+2 m-1}=a_{k+3 m-1}=0 \\). But, since either \\( k+m-1 \\) or \\( k+2 m-1 \\) is even, that would imply that \\( a_{k+m}=a_{k+2 m}=1 \\), a contradiction.\n\nThus \\( m \\) must be even. Extracting the terms with even indices in\n\\[\na_{k+j}=a_{k+m+j}=a_{k+2 m+j}, \\quad \\text { for } 0 \\leq j \\leq m-1,\n\\]\nand using the fact that \\( a_{r}=a_{r / 2} \\) for even \\( r \\), we get\n\\[\na_{\\lceil k / 2\\rceil+i}=a_{\\lceil k / 2\\rceil+(m / 2)+i}=a_{\\lceil k / 2\\rceil+m+i}, \\quad \\text { for } 0 \\leq i \\leq m / 2-1 .\n\\]\n(The even numbers \\( \\geq k \\) are \\( 2\\lceil k / 2\\rceil, 2\\lceil k / 2\\rceil+2, \\ldots \\).) This contradicts the minimality of \\( m \\).\n\nHence there are no such \\( k \\) and \\( m \\).\nSolution 2 (J.P. Grossman).\nLemma. Let \\( c(i, j) \\) be the number of carries when \\( i \\) is added to \\( j \\) in binary. Then \\( a_{i+j} \\equiv a_{i}+a_{j}+c(i, j)(\\bmod 2) \\).\n\nProof. Perform the addition column by column as taught in grade school, writing a \" 1 \" above the next column every time there is a carry. Then modulo 2, the total number of 1 's appearing \"above the line\" is \\( a_{i}+a_{j}+c(i, j) \\), and the total number of 1 's in the sum is \\( a_{i+j} \\). But in each column the digit of the sum is congruent modulo 2 to the sum of the 1's that appear above it. Summing over all columns yields \\( a_{i+j} \\equiv a_{i}+a_{j}+c(i, j)(\\bmod 2) \\).\n\nWe are asked to show that there is no block of \\( 2 m \\) consecutive integers such that \\( a_{k}=a_{k+m} \\) for all \\( k \\) in the block. Suppose such a block exists.\nIf \\( 2^{n} \\leq m<2^{n+1} \\), then \\( m \\) has \\( n+1 \\) bits (binary digits), and since \\( 2 m \\geq 2^{n+1} \\), any \\( 2 m \\) consecutive integers will exhibit every possible pattern of \\( n+1 \\) low bits. Let \\( \\kappa \\) be the integer in this block with the \\( n+1 \\) low bits zero. Then \\( c(\\kappa, m)=0 \\), so the lemma gives \\( a_{\\kappa+m} \\equiv a_{\\kappa}+a_{m}(\\bmod 2) \\). Since \\( a_{\\kappa+m}=a_{\\kappa} \\), we obtain \\( a_{m}=0 \\). Running this argument in reverse, we have \\( a_{k+m} \\equiv a_{k}+a_{m}(\\bmod 2) \\) and \\( c(k, m) \\equiv 0(\\bmod 2) \\) for all \\( k \\) in the block.\n\nIn particular, \\( c(k, m)=0 \\) for the \\( k \\) with the \\( n+1 \\) low bits equal to 0 except for one 1 , so \\( m \\) cannot contain the pattern 01 . Thus the binary expansion of \\( m \\) has the form \\( 1 \\cdots 10 \\cdots 0 \\); that is, \\( m=2^{n+1}-2^{s} \\) for some \\( s \\geq 0 \\).\n\nSuppose we can find \\( k_{1} \\) and \\( k_{2} \\) in the block such that \\( \\left\\lfloor k_{1} / 2^{n+1}\\right\\rfloor=\\left\\lfloor k_{2} / 2^{n+1}\\right\\rfloor \\), \\( k_{1} \\equiv 2^{s}\\left(\\bmod 2^{n+1}\\right) \\), and \\( k_{2} \\equiv 2^{s+1}\\left(\\bmod 2^{n+1}\\right) \\). Then \\( c\\left(k_{1}, m\\right)=c\\left(k_{2}, m\\right)+1 \\),\ncontradicting the fact that \\( c(k, m) \\) is even for each \\( k \\) in the block. Thus no such pair \\( \\left(k_{1}, k_{2}\\right) \\) exists.\n\nOn the other hand, since \\( 2 m \\geq 2^{n+1} \\), there does exist \\( k \\) in the block such that \\( k \\equiv 2^{s}\\left(\\bmod 2^{n+1}\\right) \\). The smallest element of the block must be at least \\( k-2^{n+1}+1 \\), or else we could take \\( k_{1}=k-2^{n+1} \\) and \\( k_{2}=k_{1}+2^{s} \\). The largest element must be at most \\( k+2^{s}-1 \\), or else we could take \\( k_{1}=k \\) and \\( k_{2}=k_{1}+2^{s} \\). Thus the block has length at most\n\\[\n2^{n+1}+2^{s}-1<2^{n+1}+2^{s+2}-2^{s+1}-1 \\leq 2^{n+2}-2^{s+1}-1=2 m-1,\n\\]\nwhich is a contradiction.\nRelated question. Show that if two adjacent blocks are identical, then the length of each is a power of 2 . Show that any power of 2 is achievable.\n\nRemark. This sequence is sometimes called the Thue-Morse sequence; see [AS] for examples of its ubiquity in mathematics, including its use by Machgielis Euwe (chess world champion 1935-37) to show that infinite games of chess may occur despite the so-called \"German rule\" which states that a draw occurs if the same sequence of moves occurs three times in succession.\n\nRelated question. Another fact discussed in \\( [\\mathrm{AS}] \\) is the following (see there for further references). The result of Christol mentioned in the remark following 1989A6 implies that the generating function \\( F(x)=\\sum_{n=0}^{\\infty} a_{n} x^{n} \\) considered as a power series with coefficients in \\( \\mathbb{F}_{2} \\), is algebraic over the field \\( \\mathbb{F}_{2}(x) \\) of rational functions with coefficients in \\( \\mathbb{F}_{2} \\). We leave it to the reader to verify that\n\\[\n(x+1)^{3} F(x)^{2}+(x+1)^{2} F(x)+x=0 .\n\\]\n\nOn the other hand, if the coefficients of \\( F(x) \\) are considered to be rational, then one can show that \\( F(x) \\) is transcendental over \\( \\mathbb{Q}(x) \\), and even that \\( F(1 / 2) \\) is a transcendental number.\n\nRelated questions. The Thue-Morse sequence has a self-similarity property: if one replaces each \" 0 \" with \" 0,1 \", and each \" 1 \" with \" 1,0 \", one recovers the original sequence. The \"extraction of terms with even indices\" in Solution 1 is just reversing this self-similarity.\n\nHere are a few more problems and results relating to \"arithmetic self-similarity\".\n(a) Show that the sequence \\( s(0), s(1), s(2), \\ldots \\), defined by \\( s(3 m)=0, s(3 m+1)= \\) \\( s(m), s(3 m+2)=1 \\), also has the property that there are not \"three identical blocks in a row\". This problem is given in [Hal, p. 156], along with a discussion of its motivation in chess.\n(b) 1993A6.\n(c) Problem 3 on the 1988 International Mathematical Olympiad [IMO88, p. 37] is: A function \\( f \\) is defined on the positive integers by\n\\[\n\\begin{aligned}\nf(1)=1, \\quad f(3)=3, \\quad f(2 n) & =f(n) \\\\\nf(4 n+1)=2 f(2 n+1)-f(n), \\quad f(4 n+3) & =3 f(2 n+1)-2 f(n)\n\\end{aligned}\n\\]\nfor all positive integers \\( n \\). Determine the number of positive integers \\( n \\), less than or equal to 1988 , for which \\( f(n)=n \\).\n(d) Also, [YY, p. 12] has a series of similar problems. For example, this Putnam problem answers the question Yaglom and Yaglom pose in Problem 124(b). The subsequent problem is harder:\n\nShow that there exist arbitrarily long sequences consisting of the digits 0,1 , 2,3 , such that no digit or sequence of digits occurs twice in succession. Show that there are solutions in which the digit 0 does not occur; thus three digits is the minimum we need to construct sequences of the desired type.",
  "vars": [
    "n",
    "k",
    "m",
    "j",
    "r",
    "i",
    "s",
    "a_n",
    "F",
    "x",
    "\\\\kappa",
    "c"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "indexnum",
        "k": "startindex",
        "m": "blocklen",
        "j": "offsetidx",
        "r": "evenidx",
        "i": "carryidx",
        "s": "bitshift",
        "a_n": "sequencea",
        "F": "genfunc",
        "x": "seriesvar",
        "\\kappa": "zerobits",
        "c": "carrynum"
      },
      "question": "number of 1's in the binary representation of $indexnum$ is even (or odd), respectively. Show that there do not exist positive integers $startindex$ and $blocklen$ such that\n\\[\nsequencea_{startindex+offsetidx} = sequencea_{startindex+blocklen+offsetidx} = sequencea_{startindex+2blocklen+offsetidx},\n\\]\nfor $0 \\leq offsetidx \\leq blocklen-1$.",
      "solution": "Solution 1. The sequence begins\n\\( 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, \\ldots \\).\nThe problem is to show that there are not \"three identical blocks in a row\".\nThe definition of \\( sequencea_{indexnum} \\) implies that \\( sequencea_{2\\,indexnum}=sequencea_{indexnum}=1-sequencea_{2\\,indexnum+1} \\).\nSuppose that there exist \\( startindex, blocklen \\) as in the problem; we may assume that \\( blocklen \\) is minimal for such examples.\n\nSuppose first that \\( blocklen \\) is odd. We'll suppose \\( sequencea_{startindex}=sequencea_{startindex+blocklen}=sequencea_{startindex+2\\,blocklen}=0 \\); the case \\( sequencea_{startindex}=1 \\) can be treated similarly. Since either \\( startindex \\) or \\( startindex+blocklen \\) is even, \\( sequencea_{startindex+1}=sequencea_{startindex+blocklen+1}=sequencea_{startindex+2\\,blocklen+1}= \\) 1. Again, since either \\( startindex+1 \\) or \\( startindex+blocklen+1 \\) is even, \\( sequencea_{startindex+2}=sequencea_{startindex+blocklen+2}=sequencea_{startindex+blocklen+2}=0 \\). By this means, we see that the terms \\( sequencea_{startindex}, sequencea_{startindex+1}, \\ldots, sequencea_{startindex+blocklen-1} \\) alternate between 0 and 1. Then since \\( blocklen-1 \\) is even, \\( sequencea_{startindex+blocklen-1}=sequencea_{startindex+2\\,blocklen-1}=sequencea_{startindex+3\\,blocklen-1}=0 \\). But, since either \\( startindex+blocklen-1 \\) or \\( startindex+2\\,blocklen-1 \\) is even, that would imply that \\( sequencea_{startindex+blocklen}=sequencea_{startindex+2\\,blocklen}=1 \\), a contradiction.\n\nThus \\( blocklen \\) must be even. Extracting the terms with even indices in\n\\[\nsequencea_{startindex+offsetidx}=sequencea_{startindex+blocklen+offsetidx}=sequencea_{startindex+2\\,blocklen+offsetidx}, \\quad \\text { for } 0 \\leq offsetidx \\leq blocklen-1,\n\\]\nand using the fact that \\( sequencea_{evenidx}=sequencea_{evenidx / 2} \\) for even \\( evenidx \\), we get\n\\[\nsequencea_{\\lceil startindex / 2\\rceil+carryidx}=sequencea_{\\lceil startindex / 2\\rceil+(blocklen / 2)+carryidx}=sequencea_{\\lceil startindex / 2\\rceil+blocklen+carryidx}, \\quad \\text { for } 0 \\leq carryidx \\leq blocklen / 2-1 .\n\\]\n(The even numbers \\( \\geq startindex \\) are \\( 2\\lceil startindex / 2\\rceil, 2\\lceil startindex / 2\\rceil+2, \\ldots \\).) This contradicts the minimality of \\( blocklen \\).\n\nHence there are no such \\( startindex \\) and \\( blocklen \\).\nSolution 2 (J.P. Grossman).\nLemma. Let \\( carrynum(carryidx, offsetidx) \\) be the number of carries when \\( carryidx \\) is added to \\( offsetidx \\) in binary. Then \\( sequencea_{carryidx+offsetidx} \\equiv sequencea_{carryidx}+sequencea_{offsetidx}+carrynum(carryidx, offsetidx)(\\bmod 2) \\).\n\nProof. Perform the addition column by column as taught in grade school, writing a \" 1 \" above the next column every time there is a carry. Then modulo 2, the total number of 1 's appearing \"above the line\" is \\( sequencea_{carryidx}+sequencea_{offsetidx}+carrynum(carryidx, offsetidx) \\), and the total number of 1 's in the sum is \\( sequencea_{carryidx+offsetidx} \\). But in each column the digit of the sum is congruent modulo 2 to the sum of the 1's that appear above it. Summing over all columns yields \\( sequencea_{carryidx+offsetidx} \\equiv sequencea_{carryidx}+sequencea_{offsetidx}+carrynum(carryidx, offsetidx)(\\bmod 2) \\).\n\nWe are asked to show that there is no block of \\( 2\\,blocklen \\) consecutive integers such that \\( sequencea_{startindex}=sequencea_{startindex+blocklen} \\) for all \\( startindex \\) in the block. Suppose such a block exists.\nIf \\( 2^{indexnum} \\leq blocklen<2^{indexnum+1} \\), then \\( blocklen \\) has \\( indexnum+1 \\) bits (binary digits), and since \\( 2\\,blocklen \\geq 2^{indexnum+1} \\), any \\( 2\\,blocklen \\) consecutive integers will exhibit every possible pattern of \\( indexnum+1 \\) low bits. Let \\( zerobits \\) be the integer in this block with the \\( indexnum+1 \\) low bits zero. Then \\( carrynum(zerobits, blocklen)=0 \\), so the lemma gives \\( sequencea_{zerobits+blocklen} \\equiv sequencea_{zerobits}+sequencea_{blocklen}(\\bmod 2) \\). Since \\( sequencea_{zerobits+blocklen}=sequencea_{zerobits} \\), we obtain \\( sequencea_{blocklen}=0 \\). Running this argument in reverse, we have \\( sequencea_{startindex+blocklen} \\equiv sequencea_{startindex}+sequencea_{blocklen}(\\bmod 2) \\) and \\( carrynum(startindex, blocklen) \\equiv 0(\\bmod 2) \\) for all \\( startindex \\) in the block.\n\nIn particular, \\( carrynum(startindex, blocklen)=0 \\) for the \\( startindex \\) with the \\( indexnum+1 \\) low bits equal to 0 except for one 1, so \\( blocklen \\) cannot contain the pattern 01. Thus the binary expansion of \\( blocklen \\) has the form \\( 1 \\cdots 10 \\cdots 0 \\); that is, \\( blocklen=2^{indexnum+1}-2^{bitshift} \\) for some \\( bitshift \\geq 0 \\).\n\nSuppose we can find \\( startindex_{1} \\) and \\( startindex_{2} \\) in the block such that \\( \\left\\lfloor startindex_{1} / 2^{indexnum+1}\\right\\rfloor=\\left\\lfloor startindex_{2} / 2^{indexnum+1}\\right\\rfloor \\), \\( startindex_{1} \\equiv 2^{bitshift}\\left(\\bmod 2^{indexnum+1}\\right) \\), and \\( startindex_{2} \\equiv 2^{bitshift+1}\\left(\\bmod 2^{indexnum+1}\\right) \\). Then \\( carrynum\\left(startindex_{1}, blocklen\\right)=carrynum\\left(startindex_{2}, blocklen\\right)+1 \\),\ncontradicting the fact that \\( carrynum(startindex, blocklen) \\) is even for each \\( startindex \\) in the block. Thus no such pair \\( \\left(startindex_{1}, startindex_{2}\\right) \\) exists.\n\nOn the other hand, since \\( 2\\,blocklen \\geq 2^{indexnum+1} \\), there does exist \\( startindex \\) in the block such that \\( startindex \\equiv 2^{bitshift}\\left(\\bmod 2^{indexnum+1}\\right) \\). The smallest element of the block must be at least \\( startindex-2^{indexnum+1}+1 \\), or else we could take \\( startindex_{1}=startindex-2^{indexnum+1} \\) and \\( startindex_{2}=startindex_{1}+2^{bitshift} \\). The largest element must be at most \\( startindex+2^{bitshift}-1 \\), or else we could take \\( startindex_{1}=startindex \\) and \\( startindex_{2}=startindex_{1}+2^{bitshift} \\). Thus the block has length at most\n\\[\n2^{indexnum+1}+2^{bitshift}-1<2^{indexnum+1}+2^{bitshift+2}-2^{bitshift+1}-1 \\leq 2^{indexnum+2}-2^{bitshift+1}-1=2\\,blocklen-1,\n\\]\nwhich is a contradiction.\nRelated question. Show that if two adjacent blocks are identical, then the length of each is a power of 2. Show that any power of 2 is achievable.\n\nRemark. This sequence is sometimes called the Thue-Morse sequence; see [AS] for examples of its ubiquity in mathematics, including its use by Machgielis Euwe (chess world champion 1935-37) to show that infinite games of chess may occur despite the so-called \"German rule\" which states that a draw occurs if the same sequence of moves occurs three times in succession.\n\nRelated question. Another fact discussed in \\( [\\mathrm{AS}] \\) is the following (see there for further references). The result of Christol mentioned in the remark following 1989A6 implies that the generating function \\( genfunc(seriesvar)=\\sum_{indexnum=0}^{\\infty} sequencea_{indexnum} seriesvar^{indexnum} \\) considered as a power series with coefficients in \\( \\mathbb{genfunc}_{2} \\), is algebraic over the field \\( \\mathbb{genfunc}_{2}(seriesvar) \\) of rational functions with coefficients in \\( \\mathbb{genfunc}_{2} \\). We leave it to the reader to verify that\n\\[\n(seriesvar+1)^{3} genfunc(seriesvar)^{2}+(seriesvar+1)^{2} genfunc(seriesvar)+seriesvar=0 .\n\\]\n\nOn the other hand, if the coefficients of \\( genfunc(seriesvar) \\) are considered to be rational, then one can show that \\( genfunc(seriesvar) \\) is transcendental over \\( \\mathbb{Q}(seriesvar) \\), and even that \\( genfunc(1 / 2) \\) is a transcendental number.\n\nRelated questions. The Thue-Morse sequence has a self-similarity property: if one replaces each \" 0 \" with \" 0,1 \", and each \" 1 \" with \" 1,0 \", one recovers the original sequence. The \"extraction of terms with even indices\" in Solution 1 is just reversing this self-similarity.\n\nHere are a few more problems and results relating to \"arithmetic self-similarity\".\n(a) Show that the sequence \\( s(0), s(1), s(2), \\ldots \\), defined by \\( s(3\\,blocklen)=0, s(3\\,blocklen+1)= \\) \\( s(blocklen), s(3\\,blocklen+2)=1 \\), also has the property that there are not \"three identical blocks in a row\". This problem is given in [Hal, p. 156], along with a discussion of its motivation in chess.\n(b) 1993A6.\n(c) Problem 3 on the 1988 International Mathematical Olympiad [IMO88, p. 37] is: A function \\( f \\) is defined on the positive integers by\n\\[\n\\begin{aligned}\nf(1)=1, \\quad f(3)=3, \\quad f(2\\,carryidx) & =f(carryidx) \\\\\nf(4\\,carryidx+1)=2 f(2\\,carryidx+1)-f(carryidx), \\quad f(4\\,carryidx+3) & =3 f(2\\,carryidx+1)-2 f(carryidx)\n\\end{aligned}\n\\]\nfor all positive integers \\( carryidx \\). Determine the number of positive integers \\( indexnum \\), less than or equal to 1988 , for which \\( f(indexnum)=indexnum \\).\n(d) Also, [YY, p. 12] has a series of similar problems. For example, this Putnam problem answers the question Yaglom and Yaglom pose in Problem 124(b). The subsequent problem is harder:\n\nShow that there exist arbitrarily long sequences consisting of the digits 0,1 , 2,3 , such that no digit or sequence of digits occurs twice in succession. Show that there are solutions in which the digit 0 does not occur; thus three digits is the minimum we need to construct sequences of the desired type."
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "pineapple",
        "k": "whiteboard",
        "m": "toothpaste",
        "j": "revelation",
        "r": "blueberry",
        "i": "marshland",
        "s": "snowflake",
        "a_n": "mangojuice",
        "F": "watermelon",
        "x": "sandcastle",
        "\\\\kappa": "dragonfruit",
        "c": "rainforest"
      },
      "question": "number of 1's in the binary representation of $pineapple$ is even (or odd),\nrespectively. Show that there do not exist positive integers $whiteboard$ and $toothpaste$\nsuch that\n\\[\nmangojuice_{whiteboard+revelation} = mangojuice_{whiteboard+toothpaste+revelation} = mangojuice_{whiteboard+2toothpaste+revelation},\n\\]\nfor $0 \\leq revelation \\leq toothpaste-1$.",
      "solution": "Solution 1. The sequence begins\n\\( 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, \\ldots \\).\nThe problem is to show that there are not \"three identical blocks in a row\".\nThe definition of \\( mangojuice_{pineapple} \\) implies that \\( mangojuice_{2 pineapple}=mangojuice_{pineapple}=1-mangojuice_{2 pineapple+1} \\).\nSuppose that there exist \\( whiteboard, toothpaste \\) as in the problem; we may assume that \\( toothpaste \\) is minimal for such examples.\n\nSuppose first that \\( toothpaste \\) is odd. We'll suppose \\( mangojuice_{whiteboard}=mangojuice_{whiteboard+toothpaste}=mangojuice_{whiteboard+2 toothpaste}=0 \\); the case \\( mangojuice_{whiteboard}=1 \\) can be treated similarly. Since either \\( whiteboard \\) or \\( whiteboard+toothpaste \\) is even, \\( mangojuice_{whiteboard+1}=mangojuice_{whiteboard+toothpaste+1}=mangojuice_{whiteboard+2 toothpaste+1}=1 \\). Again, since either \\( whiteboard+1 \\) or \\( whiteboard+toothpaste+1 \\) is even, \\( mangojuice_{whiteboard+2}=mangojuice_{whiteboard+toothpaste+2}=mangojuice_{whiteboard+toothpaste+2}=0 \\). By this means, we see that the terms \\( mangojuice_{whiteboard}, mangojuice_{whiteboard+1}, \\ldots, mangojuice_{whiteboard+toothpaste-1} \\) alternate between 0 and 1. Then since \\( toothpaste-1 \\) is even, \\( mangojuice_{whiteboard+toothpaste-1}=mangojuice_{whiteboard+2 toothpaste-1}=mangojuice_{whiteboard+3 toothpaste-1}=0 \\). But, since either \\( whiteboard+toothpaste-1 \\) or \\( whiteboard+2 toothpaste-1 \\) is even, that would imply that \\( mangojuice_{whiteboard+toothpaste}=mangojuice_{whiteboard+2 toothpaste}=1 \\), a contradiction.\n\nThus \\( toothpaste \\) must be even. Extracting the terms with even indices in\n\\[\nmangojuice_{whiteboard+revelation}=mangojuice_{whiteboard+toothpaste+revelation}=mangojuice_{whiteboard+2 toothpaste+revelation}, \\quad \\text { for } 0 \\leq revelation \\leq toothpaste-1,\n\\]\nand using the fact that \\( mangojuice_{blueberry}=mangojuice_{blueberry / 2} \\) for even \\( blueberry \\), we get\n\\[\nmangojuice_{\\lceil whiteboard / 2\\rceil+marshland}=mangojuice_{\\lceil whiteboard / 2\\rceil+(toothpaste / 2)+marshland}=mangojuice_{\\lceil whiteboard / 2\\rceil+toothpaste+marshland}, \\quad \\text { for } 0 \\leq marshland \\leq toothpaste / 2-1 .\n\\]\n(The even numbers \\( \\geq whiteboard \\) are \\( 2\\lceil whiteboard / 2\\rceil, 2\\lceil whiteboard / 2\\rceil+2, \\ldots \\).) This contradicts the minimality of \\( toothpaste \\).\n\nHence there are no such \\( whiteboard \\) and \\( toothpaste \\).\n\nSolution 2 (J.P. Grossman).\nLemma. Let \\( rainforest(marshland, revelation) \\) be the number of carries when \\( marshland \\) is added to \\( revelation \\) in binary. Then \\( mangojuice_{marshland+revelation} \\equiv mangojuice_{marshland}+mangojuice_{revelation}+rainforest(marshland, revelation)(\\bmod 2) \\).\n\nProof. Perform the addition column by column as taught in grade school, writing a \" 1 \" above the next column every time there is a carry. Then modulo 2, the total number of 1's appearing \"above the line\" is \\( mangojuice_{marshland}+mangojuice_{revelation}+rainforest(marshland, revelation) \\), and the total number of 1's in the sum is \\( mangojuice_{marshland+revelation} \\). But in each column the digit of the sum is congruent modulo 2 to the sum of the 1's that appear above it. Summing over all columns yields \\( mangojuice_{marshland+revelation} \\equiv mangojuice_{marshland}+mangojuice_{revelation}+rainforest(marshland, revelation)(\\bmod 2) \\).\n\nWe are asked to show that there is no block of \\( 2 toothpaste \\) consecutive integers such that \\( mangojuice_{whiteboard}=mangojuice_{whiteboard+toothpaste} \\) for all \\( whiteboard \\) in the block. Suppose such a block exists.\nIf \\( 2^{pineapple} \\leq toothpaste<2^{pineapple+1} \\), then \\( toothpaste \\) has \\( pineapple+1 \\) bits (binary digits), and since \\( 2 toothpaste \\geq 2^{pineapple+1} \\), any \\( 2 toothpaste \\) consecutive integers will exhibit every possible pattern of \\( pineapple+1 \\) low bits. Let \\( dragonfruit \\) be the integer in this block with the \\( pineapple+1 \\) low bits zero. Then \\( rainforest(dragonfruit, toothpaste)=0 \\), so the lemma gives \\( mangojuice_{dragonfruit+toothpaste} \\equiv mangojuice_{dragonfruit}+mangojuice_{toothpaste}(\\bmod 2) \\). Since \\( mangojuice_{dragonfruit+toothpaste}=mangojuice_{dragonfruit} \\), we obtain \\( mangojuice_{toothpaste}=0 \\). Running this argument in reverse, we have \\( mangojuice_{whiteboard+toothpaste} \\equiv mangojuice_{whiteboard}+mangojuice_{toothpaste}(\\bmod 2) \\) and \\( rainforest(whiteboard, toothpaste) \\equiv 0(\\bmod 2) \\) for all \\( whiteboard \\) in the block.\n\nIn particular, \\( rainforest(whiteboard, toothpaste)=0 \\) for the \\( whiteboard \\) with the \\( pineapple+1 \\) low bits equal to 0 except for one 1, so \\( toothpaste \\) cannot contain the pattern 01. Thus the binary expansion of \\( toothpaste \\) has the form \\( 1 \\cdots 10 \\cdots 0 \\); that is, \\( toothpaste=2^{pineapple+1}-2^{snowflake} \\) for some \\( snowflake \\geq 0 \\).\n\nSuppose we can find \\( whiteboard_{1} \\) and \\( whiteboard_{2} \\) in the block such that \\( \\left\\lfloor whiteboard_{1} / 2^{pineapple+1}\\right\\rfloor=\\left\\lfloor whiteboard_{2} / 2^{pineapple+1}\\right\\rfloor \\), \\( whiteboard_{1} \\equiv 2^{snowflake}\\left(\\bmod 2^{pineapple+1}\\right) \\), and \\( whiteboard_{2} \\equiv 2^{snowflake+1}\\left(\\bmod 2^{pineapple+1}\\right) \\). Then \\( rainforest\\left(whiteboard_{1}, toothpaste\\right)=rainforest\\left(whiteboard_{2}, toothpaste\\right)+1 \\),\ncontradicting the fact that \\( rainforest(whiteboard, toothpaste) \\) is even for each \\( whiteboard \\) in the block. Thus no such pair \\( \\left(whiteboard_{1}, whiteboard_{2}\\right) \\) exists.\n\nOn the other hand, since \\( 2 toothpaste \\geq 2^{pineapple+1} \\), there does exist \\( whiteboard \\) in the block such that \\( whiteboard \\equiv 2^{snowflake}\\left(\\bmod 2^{pineapple+1}\\right) \\). The smallest element of the block must be at least \\( whiteboard-2^{pineapple+1}+1 \\), or else we could take \\( whiteboard_{1}=whiteboard-2^{pineapple+1} \\) and \\( whiteboard_{2}=whiteboard_{1}+2^{snowflake} \\). The largest element must be at most \\( whiteboard+2^{snowflake}-1 \\), or else we could take \\( whiteboard_{1}=whiteboard \\) and \\( whiteboard_{2}=whiteboard_{1}+2^{snowflake} \\). Thus the block has length at most\n\\[\n2^{pineapple+1}+2^{snowflake}-1<2^{pineapple+1}+2^{snowflake+2}-2^{snowflake+1}-1 \\leq 2^{pineapple+2}-2^{snowflake+1}-1=2 toothpaste-1,\n\\]\nwhich is a contradiction.\nRelated question. Show that if two adjacent blocks are identical, then the length of each is a power of 2. Show that any power of 2 is achievable.\n\nRemark. This sequence is sometimes called the Thue-Morse sequence; see [AS] for examples of its ubiquity in mathematics, including its use by Machgielis Euwe (chess world champion 1935-37) to show that infinite games of chess may occur despite the so-called \"German rule\" which states that a draw occurs if the same sequence of moves occurs three times in succession.\n\nRelated question. Another fact discussed in \\( [\\mathrm{AS}] \\) is the following (see there for further references). The result of Christol mentioned in the remark following 1989A6 implies that the generating function \\( watermelon(sandcastle)=\\sum_{pineapple=0}^{\\infty} mangojuice_{pineapple} sandcastle^{pineapple} \\), considered as a power series with coefficients in \\( \\mathbb{F}_{2} \\), is algebraic over the field \\( \\mathbb{F}_{2}(sandcastle) \\) of rational functions with coefficients in \\( \\mathbb{F}_{2} \\). We leave it to the reader to verify that\n\\[\n(sandcastle+1)^{3} watermelon(sandcastle)^{2}+(sandcastle+1)^{2} watermelon(sandcastle)+sandcastle=0 .\n\\]\n\nOn the other hand, if the coefficients of \\( watermelon(sandcastle) \\) are considered to be rational, then one can show that \\( watermelon(sandcastle) \\) is transcendental over \\( \\mathbb{Q}(sandcastle) \\), and even that \\( watermelon(1 / 2) \\) is a transcendental number.\n\nRelated questions. The Thue-Morse sequence has a self-similarity property: if one replaces each \" 0 \" with \" 0,1 \", and each \" 1 \" with \" 1,0 \", one recovers the original sequence. The \"extraction of terms with even indices\" in Solution 1 is just reversing this self-similarity.\n\nHere are a few more problems and results relating to \"arithmetic self-similarity\".\n(a) Show that the sequence \\( snowflake(0), snowflake(1), snowflake(2), \\ldots \\), defined by \\( snowflake(3 toothpaste)=0, snowflake(3 toothpaste+1)=snowflake(toothpaste), snowflake(3 toothpaste+2)=1 \\), also has the property that there are not \"three identical blocks in a row\". This problem is given in [Hal, p. 156], along with a discussion of its motivation in chess.\n(b) 1993A6.\n(c) Problem 3 on the 1988 International Mathematical Olympiad [IMO88, p. 37] is: A function \\( f \\) is defined on the positive integers by\n\\[\n\\begin{aligned}\nf(1)=1, \\quad f(3)=3, \\quad f(2 toothpaste) & =f(toothpaste) \\\\\nf(4 toothpaste+1)=2 f(2 toothpaste+1)-f(toothpaste), \\quad f(4 toothpaste+3) & =3 f(2 toothpaste+1)-2 f(toothpaste)\n\\end{aligned}\n\\]\nfor all positive integers \\( toothpaste \\). Determine the number of positive integers \\( toothpaste \\), less than or equal to 1988, for which \\( f(toothpaste)=toothpaste \\).\n(d) Also, [YY, p. 12] has a series of similar problems. For example, this Putnam problem answers the question Yaglom and Yaglom pose in Problem 124(b). The subsequent problem is harder:\n\nShow that there exist arbitrarily long sequences consisting of the digits 0,1,2,3, such that no digit or sequence of digits occurs twice in succession. Show that there are solutions in which the digit 0 does not occur; thus three digits is the minimum we need to construct sequences of the desired type."
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "continuum",
        "k": "floatingpt",
        "m": "fractional",
        "j": "staticunit",
        "r": "irrational",
        "i": "constantval",
        "s": "changeless",
        "a_n": "staticval",
        "F": "annihilfn",
        "x": "constantx",
        "\\\\kappa": "infiniteid",
        "c": "dropcount"
      },
      "question": "number of 1's in the binary representation of $continuum$ is even (or odd),\nrespectively. Show that there do not exist positive integers $floatingpt$ and $fractional$\nsuch that\n\\[\na_{floatingpt+staticunit} = a_{floatingpt+fractional+staticunit} = a_{floatingpt+2fractional+staticunit},\n\\]\nfor $0 \\leq staticunit \\leq fractional-1$.",
      "solution": "Solution 1. The sequence begins\n\\( 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, \\ldots \\).\nThe problem is to show that there are not \"three identical blocks in a row\".\nThe definition of \\( staticval \\) implies that \\( a_{2 continuum}=a_{continuum}=1-a_{2 continuum+1} \\).\nSuppose that there exist \\( floatingpt, fractional \\) as in the problem; we may assume that \\( fractional \\) is minimal for such examples.\n\nSuppose first that \\( fractional \\) is odd. We'll suppose \\( a_{floatingpt}=a_{floatingpt+fractional}=a_{floatingpt+2 fractional}=0 \\); the case \\( a_{floatingpt}=1 \\) can be treated similarly. Since either \\( floatingpt \\) or \\( floatingpt+fractional \\) is even, \\( a_{floatingpt+1}=a_{floatingpt+fractional+1}=a_{floatingpt+2 fractional+1}= \\) 1. Again, since either \\( floatingpt+1 \\) or \\( floatingpt+fractional+1 \\) is even, \\( a_{floatingpt+2}=a_{floatingpt+fractional+2}=a_{floatingpt+fractional+2}=0 \\). By this means, we see that the terms \\( a_{floatingpt}, a_{floatingpt+1}, \\ldots, a_{floatingpt+fractional-1} \\) alternate between 0 and 1 . Then since \\( fractional-1 \\) is even, \\( a_{floatingpt+fractional-1}=a_{floatingpt+2 fractional-1}=a_{floatingpt+3 fractional-1}=0 \\). But, since either \\( floatingpt+fractional-1 \\) or \\( floatingpt+2 fractional-1 \\) is even, that would imply that \\( a_{floatingpt+fractional}=a_{floatingpt+2 fractional}=1 \\), a contradiction.\n\nThus \\( fractional \\) must be even. Extracting the terms with even indices in\n\\[\na_{floatingpt+staticunit}=a_{floatingpt+fractional+staticunit}=a_{floatingpt+2 fractional+staticunit}, \\quad \\text { for } 0 \\leq staticunit \\leq fractional-1,\n\\]\nand using the fact that \\( a_{irrational}=a_{irrational / 2} \\) for even \\( irrational \\), we get\n\\[\na_{\\lceil floatingpt / 2\\rceil+constantval}=a_{\\lceil floatingpt / 2\\rceil+(fractional / 2)+constantval}=a_{\\lceil floatingpt / 2\\rceil+fractional+constantval}, \\quad \\text { for } 0 \\leq constantval \\leq fractional / 2-1 .\n\\]\n(The even numbers \\( \\geq floatingpt \\) are \\( 2\\lceil floatingpt / 2\\rceil, 2\\lceil floatingpt / 2\\rceil+2, \\ldots \\).) This contradicts the minimality of \\( fractional \\).\n\nHence there are no such \\( floatingpt \\) and \\( fractional \\).\n\nSolution 2 (J.P. Grossman).\nLemma. Let \\( dropcount(constantval, staticunit) \\) be the number of carries when \\( constantval \\) is added to \\( staticunit \\) in binary. Then \\( a_{constantval+staticunit} \\equiv a_{constantval}+a_{staticunit}+dropcount(constantval, staticunit)(\\bmod 2) \\).\n\nProof. Perform the addition column by column as taught in grade school, writing a \" 1 \" above the next column every time there is a carry. Then modulo 2, the total number of 1 's appearing \"above the line\" is \\( a_{constantval}+a_{staticunit}+dropcount(constantval, staticunit) \\), and the total number of 1 's in the sum is \\( a_{constantval+staticunit} \\). But in each column the digit of the sum is congruent modulo 2 to the sum of the 1's that appear above it. Summing over all columns yields \\( a_{constantval+staticunit} \\equiv a_{constantval}+a_{staticunit}+dropcount(constantval, staticunit)(\\bmod 2) \\).\n\nWe are asked to show that there is no block of \\( 2 fractional \\) consecutive integers such that \\( a_{floatingpt}=a_{floatingpt+fractional} \\) for all \\( floatingpt \\) in the block. Suppose such a block exists.\nIf \\( 2^{continuum} \\leq fractional<2^{continuum+1} \\), then \\( fractional \\) has \\( continuum+1 \\) bits (binary digits), and since \\( 2 fractional \\geq 2^{continuum+1} \\), any \\( 2 fractional \\) consecutive integers will exhibit every possible pattern of \\( continuum+1 \\) low bits. Let \\( infiniteid \\) be the integer in this block with the \\( continuum+1 \\) low bits zero. Then \\( dropcount(infiniteid, fractional)=0 \\), so the lemma gives \\( a_{infiniteid+fractional} \\equiv a_{infiniteid}+a_{fractional}(\\bmod 2) \\). Since \\( a_{infiniteid+fractional}=a_{infiniteid} \\), we obtain \\( a_{fractional}=0 \\). Running this argument in reverse, we have \\( a_{floatingpt+fractional} \\equiv a_{floatingpt}+a_{fractional}(\\bmod 2) \\) and \\( dropcount(floatingpt, fractional) \\equiv 0(\\bmod 2) \\) for all \\( floatingpt \\) in the block.\n\nIn particular, \\( dropcount(floatingpt, fractional)=0 \\) for the \\( floatingpt \\) with the \\( continuum+1 \\) low bits equal to 0 except for one 1 , so \\( fractional \\) cannot contain the pattern 01 . Thus the binary expansion of \\( fractional \\) has the form \\( 1 \\cdots 10 \\cdots 0 \\); that is, \\( fractional=2^{continuum+1}-2^{changeless} \\) for some \\( changeless \\geq 0 \\).\n\nSuppose we can find \\( floatingpt_{1} \\) and \\( floatingpt_{2} \\) in the block such that \\( \\left\\lfloor floatingpt_{1} / 2^{continuum+1}\\right\\rfloor=\\left\\lfloor floatingpt_{2} / 2^{continuum+1}\\right\\rfloor \\), \\( floatingpt_{1} \\equiv 2^{changeless}\\left(\\bmod 2^{continuum+1}\\right) \\), and \\( floatingpt_{2} \\equiv 2^{changeless+1}\\left(\\bmod 2^{continuum+1}\\right) \\). Then \\( dropcount\\left(floatingpt_{1}, fractional\\right)=dropcount\\left(floatingpt_{2}, fractional\\right)+1 \\),\ncontradicting the fact that \\( dropcount(floatingpt, fractional) \\) is even for each \\( floatingpt \\) in the block. Thus no such pair \\( \\left(floatingpt_{1}, floatingpt_{2}\\right) \\) exists.\n\nOn the other hand, since \\( 2 fractional \\geq 2^{continuum+1} \\), there does exist \\( floatingpt \\) in the block such that \\( floatingpt \\equiv 2^{changeless}\\left(\\bmod 2^{continuum+1}\\right) \\). The smallest element of the block must be at least \\( floatingpt-2^{continuum+1}+1 \\), or else we could take \\( floatingpt_{1}=floatingpt-2^{continuum+1} \\) and \\( floatingpt_{2}=floatingpt_{1}+2^{changeless} \\). The largest element must be at most \\( floatingpt+2^{changeless}-1 \\), or else we could take \\( floatingpt_{1}=floatingpt \\) and \\( floatingpt_{2}=floatingpt_{1}+2^{changeless} \\). Thus the block has length at most\n\\[\n2^{continuum+1}+2^{changeless}-1<2^{continuum+1}+2^{changeless+2}-2^{changeless+1}-1 \\leq 2^{continuum+2}-2^{changeless+1}-1=2 fractional-1,\n\\]\nwhich is a contradiction.\nRelated question. Show that if two adjacent blocks are identical, then the length of each is a power of 2 . Show that any power of 2 is achievable.\n\nRemark. This sequence is sometimes called the Thue-Morse sequence; see [AS] for examples of its ubiquity in mathematics, including its use by Machgielis Euwe (chess world champion 1935-37) to show that infinite games of chess may occur despite the so-called \"German rule\" which states that a draw occurs if the same sequence of moves occurs three times in succession.\n\nRelated question. Another fact discussed in \\( [\\mathrm{AS}] \\) is the following (see there for further references). The result of Christol mentioned in the remark following 1989A6 implies that the generating function \\( annihilfn(constantx)=\\sum_{continuum=0}^{\\infty} a_{continuum} constantx^{continuum} \\) considered as a power series with coefficients in \\( \\mathbb{F}_{2} \\), is algebraic over the field \\( \\mathbb{F}_{2}(constantx) \\) of rational functions with coefficients in \\( \\mathbb{F}_{2} \\). We leave it to the reader to verify that\n\\[\n(constantx+1)^{3} annihilfn(constantx)^{2}+(constantx+1)^{2} annihilfn(constantx)+constantx=0 .\n\\]\n\nOn the other hand, if the coefficients of \\( annihilfn(constantx) \\) are considered to be rational, then one can show that \\( annihilfn(constantx) \\) is transcendental over \\( \\mathbb{Q}(constantx) \\), and even that \\( annihilfn(1 / 2) \\) is a transcendental number.\n\nRelated questions. The Thue-Morse sequence has a self-similarity property: if one replaces each \" 0 \" with \" 0,1 \", and each \" 1 \" with \" 1,0 \", one recovers the original sequence. The \"extraction of terms with even indices\" in Solution 1 is just reversing this self-similarity.\n\nHere are a few more problems and results relating to \"arithmetic self-similarity\".\n(a) Show that the sequence \\( changeless(0), changeless(1), changeless(2), \\ldots \\), defined by \\( changeless(3 fractional)=0, changeless(3 fractional+1)= \\) \\( changeless(fractional), changeless(3 fractional+2)=1 \\), also has the property that there are not \"three identical blocks in a row\". This problem is given in [Hal, p. 156], along with a discussion of its motivation in chess.\n(b) 1993A6.\n(c) Problem 3 on the 1988 International Mathematical Olympiad [IMO88, p. 37] is: A function \\( f \\) is defined on the positive integers by\n\\[\n\\begin{aligned}\nf(1)=1, \\quad f(3)=3, \\quad f(2 continuum) & =f(continuum) \\\\\nf(4 continuum+1)=2 f(2 continuum+1)-f(continuum), \\quad f(4 continuum+3) & =3 f(2 continuum+1)-2 f(continuum)\n\\end{aligned}\n\\]\nfor all positive integers \\( continuum \\). Determine the number of positive integers \\( continuum \\), less than or equal to 1988 , for which \\( f(continuum)=continuum \\).\n(d) Also, [YY, p. 12] has a series of similar problems. For example, this Putnam problem answers the question Yaglom and Yaglom pose in Problem 124(b). The subsequent problem is harder:\n\nShow that there exist arbitrarily long sequences consisting of the digits 0,1 , 2,3 , such that no digit or sequence of digits occurs twice in succession. Show that there are solutions in which the digit 0 does not occur; thus three digits is the minimum we need to construct sequences of the desired type."
    },
    "garbled_string": {
      "map": {
        "n": "qzxwvtnp",
        "k": "hjgrksla",
        "m": "vbdlmoei",
        "j": "psifznud",
        "r": "ozpkvewy",
        "i": "cnjtuasr",
        "s": "mwfryalp",
        "a_n": "esbckqeno",
        "F": "ljauyhkz",
        "x": "wbtrmofa",
        "\\kappa": "zgiduxen",
        "c": "tfjzlemq"
      },
      "question": "number of 1's in the binary representation of $qzxwvtnp$ is even (or odd), respectively. Show that there do not exist positive integers $hjgrksla$ and $vbdlmoei$ such that\n\\[\nesbckqeno_{hjgrksla+psifznud} = esbckqeno_{hjgrksla+vbdlmoei+psifznud} = esbckqeno_{hjgrksla+2vbdlmoei+psifznud},\n\\]\nfor $0 \\leq psifznud \\leq vbdlmoei-1$.",
      "solution": "Solution 1. The sequence begins\n\\( 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, \\ldots \\).\nThe problem is to show that there are not \"three identical blocks in a row\".\nThe definition of \\( esbckqeno_{qzxwvtnp} \\) implies that \\( esbckqeno_{2 qzxwvtnp}=esbckqeno_{qzxwvtnp}=1-esbckqeno_{2 qzxwvtnp+1} \\).\nSuppose that there exist \\( hjgrksla, vbdlmoei \\) as in the problem; we may assume that \\( vbdlmoei \\) is minimal for such examples.\n\nSuppose first that \\( vbdlmoei \\) is odd. We'll suppose \\( esbckqeno_{hjgrksla}=esbckqeno_{hjgrksla+vbdlmoei}=esbckqeno_{hjgrksla+2 vbdlmoei}=0 \\); the case \\( esbckqeno_{hjgrksla}=1 \\) can be treated similarly. Since either \\( hjgrksla \\) or \\( hjgrksla+vbdlmoei \\) is even, \\( esbckqeno_{hjgrksla+1}=esbckqeno_{hjgrksla+vbdlmoei+1}=esbckqeno_{hjgrksla+2 vbdlmoei+1}= \\) 1. Again, since either \\( hjgrksla+1 \\) or \\( hjgrksla+vbdlmoei+1 \\) is even, \\( esbckqeno_{hjgrksla+2}=esbckqeno_{hjgrksla+vbdlmoei+2}=esbckqeno_{hjgrksla+vbdlmoei+2}=0 \\). By this means, we see that the terms \\( esbckqeno_{hjgrksla}, esbckqeno_{hjgrksla+1}, \\ldots, esbckqeno_{hjgrksla+vbdlmoei-1} \\) alternate between 0 and 1. Then since \\( vbdlmoei-1 \\) is even, \\( esbckqeno_{hjgrksla+vbdlmoei-1}=esbckqeno_{hjgrksla+2 vbdlmoei-1}=esbckqeno_{hjgrksla+3 vbdlmoei-1}=0 \\). But, since either \\( hjgrksla+vbdlmoei-1 \\) or \\( hjgrksla+2 vbdlmoei-1 \\) is even, that would imply that \\( esbckqeno_{hjgrksla+vbdlmoei}=esbckqeno_{hjgrksla+2 vbdlmoei}=1 \\), a contradiction.\n\nThus \\( vbdlmoei \\) must be even. Extracting the terms with even indices in\n\\[\nesbckqeno_{hjgrksla+psifznud}=esbckqeno_{hjgrksla+vbdlmoei+psifznud}=esbckqeno_{hjgrksla+2 vbdlmoei+psifznud}, \\quad \\text { for } 0 \\leq psifznud \\leq vbdlmoei-1,\n\\]\nand using the fact that \\( esbckqeno_{ozpkvewy}=esbckqeno_{ozpkvewy / 2} \\) for even \\( ozpkvewy \\), we get\n\\[\nesbckqeno_{\\lceil hjgrksla / 2\\rceil+cnjtuasr}=esbckqeno_{\\lceil hjgrksla / 2\\rceil+(vbdlmoei / 2)+cnjtuasr}=esbckqeno_{\\lceil hjgrksla / 2\\rceil+vbdlmoei+cnjtuasr}, \\quad \\text { for } 0 \\leq cnjtuasr \\leq vbdlmoei / 2-1 .\n\\]\n(The even numbers \\( \\geq hjgrksla \\) are \\( 2\\lceil hjgrksla / 2\\rceil, 2\\lceil hjgrksla / 2\\rceil+2, \\ldots \\).) This contradicts the minimality of \\( vbdlmoei \\).\n\nHence there are no such \\( hjgrksla \\) and \\( vbdlmoei \\).\n\nSolution 2 (J.P. Grossman).\nLemma. Let \\( tfjzlemq(cnjtuasr, psifznud) \\) be the number of carries when \\( cnjtuasr \\) is added to \\( psifznud \\) in binary. Then \\( esbckqeno_{cnjtuasr+psifznud} \\equiv esbckqeno_{cnjtuasr}+esbckqeno_{psifznud}+tfjzlemq(cnjtuasr, psifznud)(\\bmod 2) \\).\n\nProof. Perform the addition column by column as taught in grade school, writing a \" 1 \" above the next column every time there is a carry. Then modulo 2, the total number of 1's appearing \"above the line\" is \\( esbckqeno_{cnjtuasr}+esbckqeno_{psifznud}+tfjzlemq(cnjtuasr, psifznud) \\), and the total number of 1's in the sum is \\( esbckqeno_{cnjtuasr+psifznud} \\). But in each column the digit of the sum is congruent modulo 2 to the sum of the 1's that appear above it. Summing over all columns yields \\( esbckqeno_{cnjtuasr+psifznud} \\equiv esbckqeno_{cnjtuasr}+esbckqeno_{psifznud}+tfjzlemq(cnjtuasr, psifznud)(\\bmod 2) \\).\n\nWe are asked to show that there is no block of \\( 2 vbdlmoei \\) consecutive integers such that \\( esbckqeno_{hjgrksla}=esbckqeno_{hjgrksla+vbdlmoei} \\) for all \\( hjgrksla \\) in the block. Suppose such a block exists.\nIf \\( 2^{qzxwvtnp} \\leq vbdlmoei<2^{qzxwvtnp+1} \\), then \\( vbdlmoei \\) has \\( qzxwvtnp+1 \\) bits (binary digits), and since \\( 2 vbdlmoei \\geq 2^{qzxwvtnp+1} \\), any \\( 2 vbdlmoei \\) consecutive integers will exhibit every possible pattern of \\( qzxwvtnp+1 \\) low bits. Let \\( zgiduxen \\) be the integer in this block with the \\( qzxwvtnp+1 \\) low bits zero. Then \\( tfjzlemq(zgiduxen, vbdlmoei)=0 \\), so the lemma gives \\( esbckqeno_{zgiduxen+vbdlmoei} \\equiv esbckqeno_{zgiduxen}+esbckqeno_{vbdlmoei}(\\bmod 2) \\). Since \\( esbckqeno_{zgiduxen+vbdlmoei}=esbckqeno_{zgiduxen} \\), we obtain \\( esbckqeno_{vbdlmoei}=0 \\). Running this argument in reverse, we have \\( esbckqeno_{hjgrksla+vbdlmoei} \\equiv esbckqeno_{hjgrksla}+esbckqeno_{vbdlmoei}(\\bmod 2) \\) and \\( tfjzlemq(hjgrksla, vbdlmoei) \\equiv 0(\\bmod 2) \\) for all \\( hjgrksla \\) in the block.\n\nIn particular, \\( tfjzlemq(hjgrksla, vbdlmoei)=0 \\) for the \\( hjgrksla \\) with the \\( qzxwvtnp+1 \\) low bits equal to 0 except for one 1, so \\( vbdlmoei \\) cannot contain the pattern 01. Thus the binary expansion of \\( vbdlmoei \\) has the form \\( 1 \\cdots 10 \\cdots 0 \\); that is, \\( vbdlmoei=2^{qzxwvtnp+1}-2^{mwfryalp} \\) for some \\( mwfryalp \\geq 0 \\).\n\nSuppose we can find \\( hjgrksla_{1} \\) and \\( hjgrksla_{2} \\) in the block such that \\( \\left\\lfloor hjgrksla_{1} / 2^{qzxwvtnp+1}\\right\\rfloor=\\left\\lfloor hjgrksla_{2} / 2^{qzxwvtnp+1}\\right\\rfloor \\), \\( hjgrksla_{1} \\equiv 2^{mwfryalp}(\\bmod 2^{qzxwvtnp+1}) \\), and \\( hjgrksla_{2} \\equiv 2^{mwfryalp+1}(\\bmod 2^{qzxwvtnp+1}) \\). Then \\( tfjzlemq\\left(hjgrksla_{1}, vbdlmoei\\right)=tfjzlemq\\left(hjgrksla_{2}, vbdlmoei\\right)+1 \\),\ncontradicting the fact that \\( tfjzlemq(hjgrksla, vbdlmoei) \\) is even for each \\( hjgrksla \\) in the block. Thus no such pair \\( \\left(hjgrksla_{1}, hjgrksla_{2}\\right) \\) exists.\n\nOn the other hand, since \\( 2 vbdlmoei \\geq 2^{qzxwvtnp+1} \\), there does exist \\( hjgrksla \\) in the block such that \\( hjgrksla \\equiv 2^{mwfryalp}(\\bmod 2^{qzxwvtnp+1}) \\). The smallest element of the block must be at least \\( hjgrksla-2^{qzxwvtnp+1}+1 \\), or else we could take \\( hjgrksla_{1}=hjgrksla-2^{qzxwvtnp+1} \\) and \\( hjgrksla_{2}=hjgrksla_{1}+2^{mwfryalp} \\). The largest element must be at most \\( hjgrksla+2^{mwfryalp}-1 \\), or else we could take \\( hjgrksla_{1}=hjgrksla \\) and \\( hjgrksla_{2}=hjgrksla_{1}+2^{mwfryalp} \\). Thus the block has length at most\n\\[\n2^{qzxwvtnp+1}+2^{mwfryalp}-1<2^{qzxwvtnp+1}+2^{mwfryalp+2}-2^{mwfryalp+1}-1 \\leq 2^{qzxwvtnp+2}-2^{mwfryalp+1}-1=2 vbdlmoei-1,\n\\]\nwhich is a contradiction.\n\nRelated question. Show that if two adjacent blocks are identical, then the length of each is a power of 2. Show that any power of 2 is achievable.\n\nRemark. This sequence is sometimes called the Thue-Morse sequence; see [AS] for examples of its ubiquity in mathematics, including its use by Machgielis Euwe (chess world champion 1935-37) to show that infinite games of chess may occur despite the so-called \"German rule\" which states that a draw occurs if the same sequence of moves occurs three times in succession.\n\nRelated question. Another fact discussed in \\( [\\mathrm{AS}] \\) is the following (see there for further references). The result of Christol mentioned in the remark following 1989A6 implies that the generating function \\( ljauyhkz(wbtrmofa)=\\sum_{qzxwvtnp=0}^{\\infty} esbckqeno_{qzxwvtnp} \\; wbtrmofa^{qzxwvtnp} \\), considered as a power series with coefficients in \\( \\mathbb{F}_{2} \\), is algebraic over the field \\( \\mathbb{F}_{2}(wbtrmofa) \\) of rational functions with coefficients in \\( \\mathbb{F}_{2} \\). We leave it to the reader to verify that\n\\[\n(wbtrmofa+1)^{3} ljauyhkz(wbtrmofa)^{2}+(wbtrmofa+1)^{2} ljauyhkz(wbtrmofa)+wbtrmofa=0 .\n\\]\n\nOn the other hand, if the coefficients of \\( ljauyhkz(wbtrmofa) \\) are considered to be rational, then one can show that \\( ljauyhkz(wbtrmofa) \\) is transcendental over \\( \\mathbb{Q}(wbtrmofa) \\), and even that \\( ljauyhkz(1 / 2) \\) is a transcendental number.\n\nRelated questions. The Thue-Morse sequence has a self-similarity property: if one replaces each \" 0 \" with \" 0,1 \", and each \" 1 \" with \" 1,0 \", one recovers the original sequence. The \"extraction of terms with even indices\" in Solution 1 is just reversing this self-similarity.\n\nHere are a few more problems and results relating to \"arithmetic self-similarity\".\n(a) Show that the sequence \\( mwfryalp(0), mwfryalp(1), mwfryalp(2), \\ldots \\), defined by \\( mwfryalp(3 vbdlmoei)=0, mwfryalp(3 vbdlmoei+1)= mwfryalp(vbdlmoei), mwfryalp(3 vbdlmoei+2)=1 \\), also has the property that there are not \"three identical blocks in a row\". This problem is given in [Hal, p. 156], along with a discussion of its motivation in chess.\n(b) 1993A6.\n(c) Problem 3 on the 1988 International Mathematical Olympiad [IMO88, p. 37] is: A function \\( f \\) is defined on the positive integers by\n\\[\n\\begin{aligned}\nf(1)=1, \\quad f(3)=3, \\quad f(2 qzxwvtnp) & =f(qzxwvtnp) \\\\\nf(4 qzxwvtnp+1)=2 f(2 qzxwvtnp+1)-f(qzxwvtnp), \\quad f(4 qzxwvtnp+3) & =3 f(2 qzxwvtnp+1)-2 f(qzxwvtnp)\n\\end{aligned}\n\\]\nfor all positive integers \\( qzxwvtnp \\). Determine the number of positive integers \\( qzxwvtnp \\), less than or equal to 1988, for which \\( f(qzxwvtnp)=qzxwvtnp \\).\n(d) Also, [YY, p. 12] has a series of similar problems. For example, this Putnam problem answers the question Yaglom and Yaglom pose in Problem 124(b). The subsequent problem is harder:\n\nShow that there exist arbitrarily long sequences consisting of the digits 0,1,2,3, such that no digit or sequence of digits occurs twice in succession. Show that there are solutions in which the digit 0 does not occur; thus three digits is the minimum we need to construct sequences of the desired type."
    },
    "kernel_variant": {
      "question": "Let \\((b_n)_{n\\ge 0}\\) be the infinite \\(0\\!\\)-\\(1\\) sequence defined by\n\\[\n  b_n = \\begin{cases}1, &\\text{if the number of 1\\!'s in the binary expansion of }n\\text{ is even},\\\\[4pt]0, &\\text{if the number of 1\\!'s is odd}.\\end{cases}\n\\]\n(Thus \\(b_0=1, b_1=0, b_2=0, b_3=1,\\ldots\\).)\n\nShow that there do not exist positive integers \\(k\\) and \\(m\\) for which the five successive blocks\n\\[\n  (b_{k+j})_{j=0}^{m-1},\\; (b_{k+m+j})_{j=0}^{m-1},\\; (b_{k+2m+j})_{j=0}^{m-1},\\; (b_{k+3m+j})_{j=0}^{m-1},\\; (b_{k+4m+j})_{j=0}^{m-1}\n\\]\nare all identical.\n",
      "solution": "We prove by contradiction that no three identical consecutive blocks of length m can occur; this immediately rules out five identical blocks as well.  Recall the Thue–Morse recurrences for all n≥0:  b_{2n}=b_n,  b_{2n+1}=1−b_n.  Suppose there exist positive k,m for which the three blocks\n  B₀=(b_{k+j})_{j=0}^{m−1},\n  B₁=(b_{k+m+j})_{j=0}^{m−1},\n  B₂=(b_{k+2m+j})_{j=0}^{m−1}\nare all equal.  Among all such counter-examples choose one with m minimal.\n\nCase 1: m odd.  Let a=b_k=b_{k+m}=b_{k+2m}.  Since m is odd, for each j=0,…,m−2 exactly one of k+j and k+m+j is even.  If i=k+j is even then b_{i+1}=1−b_i; if i'=k+m+j is even then b_{i'+1}=1−b_{i'}.  In either case, because B₀=B₁ we get b_{k+j+1}=1−b_{k+j}.  Hence B₀ alternates a,1−a,a,….  Since m is odd the last term b_{k+m−1}=a.  Now for j=m−1 one of k+m−1 or k+2m−1 is even, so one of b_{k+m} or b_{k+2m} would be 1−b_{k+m−1}=1−a, contradicting b_{k+m}=b_{k+2m}=a.\n\nCase 2: m even.  Write m=2t and set p=⌈k/2⌉.  Then the even integers in [k,k+m−1] are exactly\n    2p,\n    2p+2,\n    …,\n    2p+2(t−1),\nand since m is even the same shifts in the next two blocks remain even.  Hence for each i=0,…,t−1,\n    b_{2p+2i}=b_{p+i},\n    b_{2p+2i+m}=b_{(2p+2i)+2t}=b_{p+t+i},\n    b_{2p+2i+2m}=b_{(2p+2i)+4t}=b_{p+2t+i}.\nBecause these three values lie in B₀,B₁,B₂ respectively and the blocks are equal, we get b_{p+i}=b_{p+t+i}=b_{p+2t+i} for i=0,…,t−1.  That is three identical blocks of length t<m, contradicting minimality of m.\n\nIn both cases we reach a contradiction.  Therefore no positive k,m exist with even three consecutive identical blocks, and in particular no five successive blocks can all coincide.",
      "_meta": {
        "core_steps": [
          "Use the Thue–Morse self-similarity a_{2n}=a_n and a_{2n+1}=1−a_n.",
          "Assume, for a contradiction, a smallest m with three consecutive identical length-m blocks (indices k, k+m, k+2m).",
          "Show an odd m forces the block to alternate 0,1,…, contradicting equality of the last elements.",
          "If m is even, look at the even indices (halve them) to obtain a shorter counterexample, violating minimality.",
          "Hence no such k and m exist."
        ],
        "mutable_slots": {
          "slot1": {
            "description": "Which digit (0 or 1) is assigned to an even number of 1’s in the binary expansion.",
            "original": "even → 0, odd → 1"
          },
          "slot2": {
            "description": "The exact count of consecutive identical blocks demanded; any requirement of ≥3 blocks still contains a forbidden triple.",
            "original": "3 blocks"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}