{
  "index": "2020-B-6",
  "type": "NT",
  "tag": [
    "NT",
    "COMB",
    "ANA"
  ],
  "difficulty": "",
  "question": "Let $n$ be a positive integer. Prove that\n\\[\n\\sum_{k=1}^n (-1)^{\\lfloor k(\\sqrt{2}-1) \\rfloor} \\geq 0.\n\\]\n(As usual, $\\lfloor x \\rfloor$ denotes the greatest integer less than or equal to $x$.)\n\n\\end{itemize}\n\n\\end{document}",
  "solution": "\\noindent\n\\textbf{First solution.}\nDefine the sequence $\\{a_k\\}_{k=0}^\\infty$ by $a_k = \\lfloor k(\\sqrt{2}-1)\\rfloor$. The first few terms of the sequence $\\{(-1)^{a_k}\\}$ are\n\\[\n1,1,1,-1,-1,1,1,1,-1,-1,1,1,1,\\ldots.\n\\]\nDefine a new sequence $\\{c_i\\}_{i=0}^\\infty$ given by $3,2,3,2,3,\\ldots$, whose members alternately are the lengths of the clusters of consecutive $1$'s and the lengths of the clusters of consecutive $-1$'s in the sequence $\\{(-1)^{a_k}\\}$. Then for any $i$, $c_0+\\cdots+c_i$ is the number of nonnegative integers $k$ such that $\\lfloor k(\\sqrt{2}-1) \\rfloor$ is strictly less than $i+1$, i.e., such that $k(\\sqrt{2}-1)<i+1$. This last condition is equivalent to $k<(i+1)(\\sqrt{2}+1)$, and we conclude that \\begin{align*}\nc_0+\\cdots+c_i &= \\lfloor (i+1)(\\sqrt{2}+1)\\rfloor  + 1 \\\\\n&= 2i+3+\\lfloor (i+1)(\\sqrt{2}-1)\\rfloor.\n\\end{align*}\nThus for $i>0$,\n\\begin{equation} \\label{eq:2020B6eq1}\nc_i =2+\\lfloor (i+1)(\\sqrt{2}-1)\\rfloor-\\lfloor i(\\sqrt{2}-1) \\rfloor.\n\\end{equation}\nNow note that $\\lfloor (i+1)(\\sqrt{2}-1)\\rfloor-\\lfloor i(\\sqrt{2}-1) \\rfloor$ is either $1$ or $0$ depending on whether or not there is an integer $j$ between $i(\\sqrt{2}-1)$ and $(i+1)(\\sqrt{2}-1)$: this condition is equivalent to $i<j(\\sqrt{2}+1)<i+1$. That is, for $i>0$,\n\\begin{equation} \\label{eq:2020B6eq3}\nc_i = \\begin{cases} 3 & \\text{if } i=\\lfloor j(\\sqrt{2}+1)\\rfloor \\text{ for some integer }j, \\\\\n2 &\\text{otherwise};\n\\end{cases}\n\\end{equation}\nby inspection, this also holds for $i=0$.\n\nNow we are asked to prove that\n\\begin{equation}\\label{eq:2020B6eq2}\n\\sum_{k=0}^n (-1)^{a_k} \\geq 1\n\\end{equation}\nfor all $n\\geq 1$. We will prove that if \\eqref{eq:2020B6eq2} holds for all $n\\leq N$, then \\eqref{eq:2020B6eq2} holds for all $n\\leq 4N$; since \\eqref{eq:2020B6eq2} clearly holds for $n=1$, this will imply the desired result.\n\nSuppose that \\eqref{eq:2020B6eq2} holds for $n\\leq N$. To prove that \\eqref{eq:2020B6eq2} holds for $n\\leq 4N$, it suffices to show that the partial sums\n\\[\n\\sum_{i=0}^m (-1)^i c_i\n\\]\nof the sequence $\\{(-1)^{a_k}\\}$ are positive for all $m$ such that $c_0+\\cdots+c_{m-1}<4N+3$, since these partial sums cover all clusters through $a_{4N}$. Now if $c_0+\\cdots+c_{m-1}<4N+3$, then since each $c_i$ is at least $2$, we must have $m<2N+2$. From \\eqref{eq:2020B6eq3}, we see that if $m$ is odd, then\n\\begin{align*}\n\\sum_{i=0}^m (-1)^i c_i &= \\sum_{i=0}^m (-1)^i (c_i-2) \\\\\n&= \\sum_j (-1)^{\\lfloor j(\\sqrt{2}+1)\\rfloor} = \\sum_j (-1)^{a_j}\n\\end{align*}\nwhere the sum in $j$ is over nonnegative integers $j$ with $j(\\sqrt{2}+1) < m$, i.e., $j <m(\\sqrt{2}-1)$; since $m(\\sqrt{2}-1)<m/2<N+1$,\n$\\sum_j (-1)^{a_j}$ is positive by the induction hypothesis. Similarly, if $m$ is even, then $\\sum_{i=0}^m (-1)^i c_i = c_m+ \\sum_j (-1)^{a_j}$ and this is again positive by the induction hypothesis. This concludes the induction step and the proof.\n\n\\noindent\n\\textbf{Remark.}\nMore generally, using the same proof we can establish the result with $\\sqrt{2}-1$ replaced by $\\sqrt{n^2+1}-n$ for any positive integer $n$.\n\n\n\\noindent\n\\textbf{Second solution.}\nFor $n \\geq 0$, define the function \n\\[\nf(n) = \\sum_{k=1}^n (-1)^{\\lfloor k (\\sqrt{2}-1) \\rfloor}\n\\]\nwith the convention that $f(0) = 0$.\n\nDefine the sequence $q_0, q_1, \\dots$ by the initial conditions\n\\[\nq_0 = 0, q_1 = 1\n\\]\nand the recurrence relation\n\\[\n\\qquad q_j = 2q_{j-1} + q_{j-2}.\n\\]\nThis is OEIS sequence A000129; its first few terms are\n\\[\n0,1,2,5,12,29,70,\\dots.\n\\]\nNote that $q_j \\equiv j \\pmod{2}$.\n\nWe now observe that the fractions $q_{j-1}/q_j$ are the \\emph{convergents} of the continued fraction expansion of $\\sqrt{2}-1$.\nThis implies the following additional properties of the sequence.\n\\begin{itemize}\n\\item\nFor all $j \\geq 0$, \n\\[\n\\frac{q_{2j}}{q_{2j+1}} < \\sqrt{2}-1 < \\frac{q_{2j+1}}{q_{2j+2}}.\n\\]\n\\item\nThere is no fraction $r/s$ with $s < q_j + q_{j+1}$ such that\n$\\frac{r}{s}$ separates $\\sqrt{2}-1$ from $q_j/q_{j-1}$. In particular, for $k < q_j + q_{j+1}$,\n\\[\n\\lfloor k (\\sqrt{2}-1) \\rfloor = \\left\\lfloor \\frac{kq_{j-1}}{q_j} \\right\\rfloor\n\\]\nexcept when $j$ is even and $k \\in \\{q_j, 2q_j\\}$, in which case they differ by 1.\n\\end{itemize}\n\nWe use this to deduce a ``self-similarity'' property of $f(n)$.\n\\setcounter{lemma}{0}\n\\begin{lemma}\nLet $n,j$ be nonnegative integers with $q_j \\leq n < q_j + q_{j+1}$.\n\\begin{itemize}\n\\item[(a)]\nIf $j$ is even, then\n\\[\nf(n) = f(q_j) - f(n-q_j).\n\\]\n\\item[(b)]\nIf $j$ is odd, then\n\\[\nf(n) = f(n-q_{j}) + 1.\n\\]\n\\end{itemize}\n\\end{lemma}\n\\begin{proof}\nIf $j$ is even, then\n\\begin{align*}\nf(n) &= f(q_j) + \\sum_{k=q_j+1}^n (-1)^{\\lfloor k(\\sqrt{2}-1) \\rfloor} \\\\\n&= f(q_j) + \\sum_{k=q_j+1}^n (-1)^{\\lfloor kq_{j-1}/q_j \\rfloor} + *\n\\end{align*}\nwhere $*$ equals 2 if $n \\geq 2q_j$ (accounting for the term $k = 2q_j$) and 0 otherwise.\nContinuing,\n\\begin{align*}\nf(n)\n&= f(q_j) + \\sum_{1}^{n-q_j} (-1)^{q_{j-1} + \\lfloor kq_{j-1}/q_j \\rfloor} + * \\\\\n&= f(q_j) - \\sum_{1}^{n-q_j} (-1)^{q_{j-1} + \\lfloor k(\\sqrt{2}-1) \\rfloor}\\\\\n&= f(q_j) - f(n-q_j).\n\\end{align*}\nIf $j$ is odd, then\n\\begin{align*}\nf(n) &= f(n-q_j) + \\sum_{k=n-q_j+1}^n (-1)^{\\lfloor k(\\sqrt{2}-1) \\rfloor} \\\\\n&= f(n-q_j) -2 + \\sum_{k=n-q_j+1}^n (-1)^{\\lfloor kq_{j-1}/q_j \\rfloor}.\n\\end{align*}\nSince \n\\[\n\\lfloor (k+q_j)q_{j-1}/q_j \\rfloor \\equiv \\lfloor kq_{j-1}/q_j \\rfloor \\pmod{2},\n\\]\nwe also have\n\\[\nf(n) = f(n-q_j) + \\sum_{k=1}^{q_j} (-1)^{\\lfloor kq_{j-1}/q_j \\rfloor}.\n\\]\nIn this sum, the summand indexed by $q_j$ contributes 1, and the summands indexed by $k$ and $q_j-k$ cancel each other out for \n$k=1,\\dots,q_j-1$. We thus have\n\\[\nf(n) = f(n-q_j) + 1\n\\]\nas claimed.\n\\end{proof}\n\nFrom Lemma~1, we have\n\\[\nf(q_{2j}) = f(q_{2j} - 2q_{2j-1}) + 2 = f(q_{2j-2}) + 2.\n\\]\nBy induction on $j$, $f(q_{2j}) = 2j$ for all $j \\geq 0$;\nby similar logic, we have $f(n) \\leq f(q_{2j}) = 2j$ for all $n \\leq q_{2j}$.\nWe can now apply Lemma~1 once more to deduce that $f(n) \\geq 0$ for all $j$.\n\n\\noindent\n\\textbf{Remark.}\nAs a byproduct of the first solution, we confirm the equality of two sequences that were entered separately in the OEIS but conjectured to be equal:\nA097509 (indexed from 0) matches the definition of $\\{c_i\\}$, while A276862 (indexed from 1)\nmatches the characterization of $\\{c_{i-1}\\}$ given by \\eqref{eq:2020B6eq1}.\n\n\\noindent\n\\textbf{Remark.}\nWe can confirm an additional conjecture from the OEIS by showing that in the notation of the first solution,\nthe sequence $a(n) = c_{n+1}$ indexed from 1 equals\nA082844: ``Start with 3,2 and apply the rule $a(a(1)+a(2)+\\cdots+a(n)) = a(n)$, fill in any undefined terms with $a(t) = 2$ if $a(t-1) = 3$ and $a(t) = 3$ if $a(t-1) = 2$.'' We first verify the recursion. By \\eqref{eq:2020B6eq2},\n\\begin{align*}\na(1) + \\cdots + a(n) &= c_0 + \\cdots + c_{n+1} - c_0 - c_1 \\\\\n&= \\lfloor (n+2)(\\sqrt{2}+1) \\rfloor - 4.\n\\end{align*}\nFrom \\eqref{eq:2020B6eq3}, we see that\n$a(a(1) + \\cdots + a(n)+3) = 3$. Consequently,\nexactly one of $a(a(1) + \\cdots + a(n))$ or $a(a(1) + \\cdots + a(n)+1)$ equals 3,\nand it is the former if and only if\n\\[\n\\lfloor (n+2)(\\sqrt{2}+1) \\rfloor - 3 = \\lfloor (n+1)(\\sqrt{2}+1) \\rfloor,\n\\]\ni.e., if and only if $a(n) = c_{n+1} = 3$.\n\nWe next check that the definition correctly fills in values not determined by the recursion. If \n$a(n) = 3$, then $a(a(1) + \\cdots + a(n)+1) = 2$ because no two consecutive values can both equal 3;\nby the same token, $a(n+1) = 2$ and so there are no further values to fill in. If $a(n) = 2$, then $a(a(1) + \\cdots + a(n)+1) = 3$ by the previous paragraph;\nthis in turn implies $a(a(1) + \\cdots + a(n)+2) = 2$, at which point there are no further values to fill in.\n\n\\noindent\n\\textbf{Remark.}\nWe can confirm an additional conjecture from the OEIS by showing that in the notation of the first solution,\nthe sequence $\\{c_i\\}$ equals\nA245219. This depends on some additional lemmas.\n\\begin{lemma}\nLet $k$ be a positive integer. Then\n\\[\n\\left\\{ i(\\sqrt{2}-1) \\right\\} < \\left\\{ k(\\sqrt{2}-1) \\right\\} \\qquad (i=0,\\dots,k-1)\n\\]\nif and only if $k = q_{2j}$ or $k = q_{2j}+q_{2j-1}$ for some $j>0$.\n\\end{lemma}\n\\begin{proof}\nFor each $j>0$, we have\n\\[\n\\frac{q_{2j-2}}{q_{2j-1}} < \\frac{q_{2j}}{q_{2j+1}} = \\frac{q_{2j-1} + 2q_{2j-2}}{q_{2j} + 2q_{2j-1}} < \\sqrt{2}-1 < \\frac{q_{2j+1}}{q_{2j+2}} < \\frac{q_{2j-1}}{q_{2j}}.\n\\]\nWe also have\n\\[\n\\frac{q_{2j-2}}{q_{2j-1}} < \\frac{q_{2j}}{q_{2j+1}} = \\frac{q_{2j-1} + 2q_{2j-2}}{q_{2j} + 2q_{2j-1}} < \\frac{q_{2j-1} + q_{2j-2}}{q_{2j} + q_{2j-1}}  < \\frac{q_{2j-1}}{q_{2j}}.\n\\]\nMoreover, $\\frac{q_{2j-1}+q_{2j-2}}{q_{2j}+q_{2j-1}}$ cannot be  less than $\\sqrt{2}-1$, or else it would be a better approximation to $\\sqrt{2}-1$\nthan the convergent $q_{2j}/q_{2j+1}$ with $q_{2j+1} > q_{2j}+q_{2j-1}$. By the same token, $\\frac{q_{2j-1}+q_{2j-2}}{q_{2j}+q_{2j-1}}$ cannot be a  better approximation to\n$\\sqrt{2}-1$ than $q_{2j+1}/q_{2j+2}$. We thus have\n\\[\n\\frac{q_{2j}}{q_{2j+1}} < \\sqrt{2}-1 < \\frac{q_{2j+1}}{q_{2j+2}} < \\frac{q_{2j-1} + q_{2j-2}}{q_{2j} + q_{2j-1}} < \\frac{q_{2j-1}}{q_{2j}}.\n\\]\nFrom this, we see that\n\\[\n\\{q_{2j}(\\sqrt{2}-1)\\} < \\{(q_{2j}+q_{2j-1})(\\sqrt{2}-1)\\} < \\{q_{2j+2}(\\sqrt{2}-1)\\}.\n\\]\nIt will now suffice to show that for $q_{2j} < k < q_{2j}+q_{2j-1}$,\n\\[\n\\{k(\\sqrt{2}-1)\\} < \\{q_{2j}(\\sqrt{2}-1)\\}\n\\]\nwhile for $q_{2j}+q_{2j-1} < k < q_{2j+2}$,\n\\[\n\\{k(\\sqrt{2}-1)\\} < \\{(q_{2j}+q_{2j-1})(\\sqrt{2}-1)\\}.\n\\]\nThe first of these assertion is an immediate consequence of the ``best approximation'' property of the convergent $q_{2j-1}/q_{2j}$.\nAs for the second assertion, note that for $k$ in this range, no fraction with denominator $k$ can lie strictly between\n$\\frac{q_{2j}}{q_{2j+1}}$ and $\\frac{q_{2j-1} + q_{2j-2}}{q_{2j} + q_{2j-1}}$ because these fractions are consecutive terms in a Farey sequence\n(that is, their difference has numerator 1 in lowest terms);\nin particular, such a fraction cannot be a better upper approximation to $\\sqrt{2}-1$ than $\\frac{q_{2j-1} + q_{2j-2}}{q_{2j} + q_{2j-1}}$.\n\\end{proof}\n\n\\begin{lemma}\nFor $j>0$, the sequence $c_0,\\dots,c_{j-1}$ is palindromic if and only if\n\\[\nj = q_{2i+1} \\qquad \\mbox{or} \\qquad j = q_{2i+1} + q_{2i+2}\n\\]\nfor some nonnegative integer $i$. (That is, $j$ must belong to one of the sequences A001653 or A001541.) In particular, $j$ must be odd.\n\\end{lemma}\n\\begin{proof}\nLet $j$ be an index for which $\\{c_0,\\dots,c_{j-1}\\}$ is palindromic.\nIn particular, $c_{j-1} = c_0 = 3$, so from \\eqref{eq:2020B6eq3}, we see that $j-1 = \\lfloor k(\\sqrt{2}+1) \\rfloor$ for some $k$.\nGiven this, the sequence is palindromic if and only if \n\\[\n\\lfloor i(\\sqrt{2}+1)\\rfloor + \\lfloor (k-i)(\\sqrt{2}+1)\\rfloor = \\lfloor k(\\sqrt{2}+1) \\rfloor \\quad (i=0,\\dots, k),\n\\]\nor equivalently\n\\[\n\\left\\{ i(\\sqrt{2}-1) \\right\\} + \\left\\{ (k-i)(\\sqrt{2}-1) \\right\\} = \\left\\{ k(\\sqrt{2}-1) \\right\\} \\quad (i=0,\\dots, k)\n\\]\nwhere the braces denote fractional parts. This holds if and only if\n\\[\n\\left\\{ i(\\sqrt{2}-1) \\right\\} < \\left\\{ k(\\sqrt{2}-1) \\right\\} \\qquad (i=0,\\dots,k-1),\n\\]\nso we may apply Lemma 2 to identify $k$ and hence $j$.\n\\end{proof}\n\n\\begin{lemma}\nFor $j>0$, if there exists a positive integer $k$ such that\n\\[\n(c_0,\\dots,c_{j-2}) = (c_k,\\dots,c_{k+j-2}) \\mbox{ but } c_{j-1} \\neq c_{k+j-1},\n\\]\nthen\n\\[\nj = q_{2i+1} \\qquad \\mbox{or} \\qquad j = q_{2i+1} + q_{2i+2}\n\\]\nfor some nonnegative integer $i$. In particular, $j$ is odd and (by Lemma 3) the sequence $(c_0,\\dots,c_{j-1})$ is palindromic.\n\\end{lemma}\n\\begin{proof}\nSince the sequence $\\{c_i\\}$ consists of 2s and 3s, we must have $\\{c_{j-1}, c_{k+j-1}\\} = \\{2,3\\}$.\nSince each pair of 3s is separated by either one or two 2s, we must have $c_{j-2} = 2$, $c_{j-3} = 3$. In particular, \nby \\eqref{eq:2020B6eq3} there is an integer $i$ for which\n$j-3 = \\lfloor (i-1)(\\sqrt{2}+1) \\rfloor$; there is also an integer $l$ such that $k = \\lfloor l(\\sqrt{2}+1) \\rfloor$.\nBy hypothesis, we have\n\\[\n\\lfloor (h+l) (\\sqrt{2}+1) \\rfloor = \\lfloor h (\\sqrt{2}+1)\\rfloor + \\lfloor l(\\sqrt{2}+1) \\rfloor\n\\]\nfor $h=0,\\dots,i-1$ but not for $h=i$. In other words,\n\\[\n\\left\\{ (h+l) (\\sqrt{2}-1) \\right\\} = \\left\\{ h (\\sqrt{2}-1) \\right\\} + \\left\\{ l(\\sqrt{2}-1) \\right\\}\n\\]\nfor $h=0,\\dots,i-1$ but not for $h=i$. That is, $\\{ h(\\sqrt{2}-1)\\}$ belongs to the interval $(0, 1-\\{ l (\\sqrt{2}-1)\\})$\nfor $h=0,\\dots,i-1$ but not for $h=i$; in particular,\n\\[\n\\left\\{ h(\\sqrt{2}-1) \\right\\} < \\left\\{ i(\\sqrt{2}-1) \\right\\} \\qquad (h=0,\\dots,i-1),\n\\]\nso we may apply Lemma 2 to identify $i$ and hence $j$.\n\\end{proof}\n\nThe sequence A245219 is defined as the sequence of coefficients of the continued fraction of $\\sup\\{b_i\\}$ where $b_1 = 1$\nand for $i>1$,\n\\[\nb_{i+1} = \\begin{cases} b_i+1 & \\mbox{if $i = \\lfloor j\\sqrt{2} \\rfloor$ for some integer $j$;} \\\\\n1/b_i & \\mbox{otherwise.}\n\\end{cases}\n\\]\nIt is equivalent to take the supremum over values of $i$ for which $b_{i+1} = 1/b_i$; by Beatty's theorem,\nthis occurs precisely when $i = \\lfloor j(2+\\sqrt{2})\\rfloor$ for some integer $j$.\nIn this case, $b_i$ has continued fraction\n\\[\n[c_{j-1}, \\dots, c_0].\n\\]\nLet $K$ be the real number with continued fraction $[c_0, c_1, \\dots]$; we must show that $K = \\sup\\{b_i\\}$.\nIn one direction, by Lemma 3, there are infinitely many values of $i$ for which $[c_{j-1}, \\dots, c_0] = [c_0, \\dots, c_{j-1}]$;\nthe corresponding values $b_i$ accumulate at $K$, so $K \\leq\\sup\\{b_i\\}$.\n\nIn the other direction, we show that $K \\geq \\sup\\{b_i\\}$ as follows. It is enough to prove that $K \\geq b_i$ when $i = \\lfloor j(2+\\sqrt{2})\\rfloor$ for some integer $j$.\n\\begin{itemize}\n\\item\nIf $c_0,\\dots,c_{j-1}$ is palindromic, then Lemma 3 implies that $j$ is odd; that is, the continued fraction $[c_{j-1},\\dots,c_0]$\nhas odd length. In this case, replacing the final term $c_0 = c_{j-1}$\nby the larger quantity $[c_{j-1}, c_j, \\dots]$ increases the value of the continued fraction.\n\\item\nIf $c_0,\\dots,c_{j-1}$ is not palindromic, then there is a least integer $k \\in \\{0,\\dots,j-1\\}$ such that $c_k\\neq c_{j-1-k}$.\nBy Lemma 3, the sequence $c_0, c_1, \\dots$ has arbitrarily long palindromic initial segments, so\nthe sequence $(c_{j-1},\\dots, c_{j-1-k})$ also occurs as $c_h, \\dots, c_{h+k}$ for some $h>0$.\nBy Lemma 4, $k$ is even and $c_k = 3 > 2 = c_{j-1-k}$; \nhence in the continued fraction for $b_i$, replacing the final segment $c_{j-1-k},\\dots,c_0$ by $c_k, c_{k+1}, \\dots$ increases the value.\n\\end{itemize}\n\n%\\noindent\n%\\textbf{Remark.}\n%The sequences $\\{a_k\\}$ and $\\{c_i\\}$ appear in the OEIS as sequences A097508 and A097509, respectively.\n%They are also the pairwise differences of the complementary sequences A003151 and A003152.\n%The sequences A097509 and A276862 were originally entered separately in the OEIS and conjectured to be equal up to shifts;\n%the above solution implies that this equality is correct.\n%(It is also conjectured that sequence A082844 matches these two; it may be possible to prove this by similar methods, but we did not check this.)\n\n\n\n\n\\end{itemize}\n\\end{document}",
  "vars": [
    "a_k",
    "b_i",
    "c_i",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "q_j",
    "r",
    "s",
    "t"
  ],
  "params": [
    "a",
    "b",
    "f",
    "K",
    "n"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "a_k": "floorseq",
        "b_i": "ratioseq",
        "c_i": "clusterseq",
        "h": "auxindex",
        "i": "indexvar",
        "j": "stepindex",
        "k": "countervar",
        "l": "ellindex",
        "m": "mindex",
        "q_j": "convergent",
        "r": "numerator",
        "s": "denominator",
        "t": "tempvar",
        "a": "asequence",
        "b": "bsequence",
        "f": "sumfunc",
        "K": "constkappa",
        "n": "uppbound"
      },
      "question": "Let \\(\\uppbound\\) be a positive integer. Prove that\n\\[\n\\sum_{\\countervar=1}^{\\uppbound} (-1)^{\\lfloor \\countervar(\\sqrt{2}-1) \\rfloor} \\ge 0.\n\\]\n(As usual, \\(\\lfloor x \\rfloor\\) denotes the greatest integer less than or equal to \\(x\\).)",
      "solution": "\\noindent\n\\textbf{First solution.}\nDefine the sequence \\(\\{\\text{floorseq}\\}_{\\countervar=0}^{\\infty}\\) by \\(\\text{floorseq}=\\lfloor \\countervar(\\sqrt{2}-1)\\rfloor\\). The first few terms of the sequence \\(\\{(-1)^{\\text{floorseq}}\\}\\) are\n\\[\n1,1,1,-1,-1,1,1,1,-1,-1,1,1,1,\\ldots.\n\\]\nDefine a new sequence \\(\\{\\text{clusterseq}\\}_{\\indexvar=0}^{\\infty}\\) given by \\(3,2,3,2,3,\\ldots\\), whose members alternately are the lengths of the clusters of consecutive \\(1\\)'s and the lengths of the clusters of consecutive \\(-1\\)'s in the sequence \\(\\{(-1)^{\\text{floorseq}}\\}\\). Then for any \\(\\indexvar\\),\n\\(\\text{clusterseq}_0+\\cdots+\\text{clusterseq}_{\\indexvar}\\) is the number of non-negative integers \\(\\countervar\\) such that \\(\\lfloor \\countervar(\\sqrt{2}-1) \\rfloor<\\indexvar+1\\), i.e. such that \\(\\countervar(\\sqrt{2}-1)<\\indexvar+1\\). This last condition is equivalent to \\(\\countervar<(\\indexvar+1)(\\sqrt{2}+1)\\), and we conclude that\n\\[\n\\text{clusterseq}_0+\\cdots+\\text{clusterseq}_{\\indexvar}=\\lfloor (\\indexvar+1)(\\sqrt{2}+1)\\rfloor+1=2\\,\\indexvar+3+\\lfloor (\\indexvar+1)(\\sqrt{2}-1)\\rfloor.\n\\]\nThus for \\(\\indexvar>0\\),\n\\begin{equation}\\label{eq:2020B6eq1}\n\\text{clusterseq}_{\\indexvar}=2+\\lfloor (\\indexvar+1)(\\sqrt{2}-1)\\rfloor-\\lfloor \\indexvar(\\sqrt{2}-1) \\rfloor.\n\\end{equation}\nNow note that \\(\\lfloor (\\indexvar+1)(\\sqrt{2}-1)\\rfloor-\\lfloor \\indexvar(\\sqrt{2}-1) \\rfloor\\) is either 1 or 0 depending on whether or not there is an integer \\(\\stepindex\\) between \\(\\indexvar(\\sqrt{2}-1)\\) and \\((\\indexvar+1)(\\sqrt{2}-1)\\): this condition is equivalent to \\(\\indexvar<\\stepindex(\\sqrt{2}+1)<\\indexvar+1\\). That is, for \\(\\indexvar>0\\),\n\\begin{equation}\\label{eq:2020B6eq3}\n\\text{clusterseq}_{\\indexvar}=\\begin{cases}3 & \\text{if } \\indexvar=\\lfloor \\stepindex(\\sqrt{2}+1)\\rfloor \\text{ for some integer }\\stepindex,\\\\[2pt]2 & \\text{otherwise.}\\end{cases}\n\\end{equation}\nBy inspection, this also holds for \\(\\indexvar=0\\).\n\nWe are asked to prove that\n\\begin{equation}\\label{eq:2020B6eq2}\n\\sum_{\\countervar=0}^{\\uppbound}(-1)^{\\text{floorseq}}\\ge1\n\\end{equation}\nfor all \\(\\uppbound\\ge1\\). We will prove that if \\eqref{eq:2020B6eq2} holds for all \\(\\uppbound\\le N\\), then it holds for all \\(\\uppbound\\le4N\\); since \\eqref{eq:2020B6eq2} clearly holds for \\(\\uppbound=1\\), this will imply the desired result.\n\nSuppose that \\eqref{eq:2020B6eq2} holds for \\(\\uppbound\\le N\\). To prove that it holds for \\(\\uppbound\\le4N\\), it suffices to show that the partial sums\n\\[\n\\sum_{\\indexvar=0}^{\\mindex}(-1)^{\\indexvar}\\,\\text{clusterseq}_{\\indexvar}\n\\]\nof the sequence \\(\\{(-1)^{\\text{floorseq}}\\}\\) are positive for all \\(\\mindex\\) such that \\(\\text{clusterseq}_0+\\cdots+\\text{clusterseq}_{\\mindex-1}<4N+3\\), because these partial sums cover all clusters through \\(\\text{floorseq}_{4N}\\). Now if \\(\\text{clusterseq}_0+\\cdots+\\text{clusterseq}_{\\mindex-1}<4N+3\\), then because each \\(\\text{clusterseq}_{\\indexvar}\\) is at least 2 we must have \\(\\mindex<2N+2\\).\n\nFrom \\eqref{eq:2020B6eq3} we see that if \\(\\mindex\\) is odd then\n\\begin{align*}\n\\sum_{\\indexvar=0}^{\\mindex}(-1)^{\\indexvar}\\,\\text{clusterseq}_{\\indexvar}&=\\sum_{\\indexvar=0}^{\\mindex}(-1)^{\\indexvar}(\\text{clusterseq}_{\\indexvar}-2)\\\\[4pt]\n&=\\sum_{\\stepindex}(-1)^{\\lfloor \\stepindex(\\sqrt{2}+1)\\rfloor}=\\sum_{\\stepindex}(-1)^{\\text{floorseq}},\n\\end{align*}\nwhere the sum in \\(\\stepindex\\) is over non-negative integers satisfying \\(\\stepindex(\\sqrt{2}+1)<\\mindex\\), i.e. \\(\\stepindex<\\mindex(\\sqrt{2}-1)\\); since \\(\\mindex(\\sqrt{2}-1)<\\mindex/2<N+1\\), this sum is positive by the induction hypothesis.  If \\(\\mindex\\) is even we have\n\\[\n\\sum_{\\indexvar=0}^{\\mindex}(-1)^{\\indexvar}\\,\\text{clusterseq}_{\\indexvar}=\\text{clusterseq}_{\\mindex}+\\sum_{\\stepindex}(-1)^{\\text{floorseq}},\n\\]\nwhich is again positive.  This completes the induction.\n\n\\smallskip\\noindent\\textbf{Remark.}  More generally, the same proof shows that the result holds with \\(\\sqrt{2}-1\\) replaced by \\(\\sqrt{\\uppbound^{2}+1}-\\uppbound\\) for any positive integer \\(\\uppbound\\).\n\n\\medskip\\noindent\\textbf{Second solution.}\nFor \\(\\uppbound\\ge0\\) define\n\\[\n\\text{sumfunc}(\\uppbound)=\\sum_{\\countervar=1}^{\\uppbound}(-1)^{\\lfloor\\countervar(\\sqrt{2}-1)\\rfloor},\n\\qquad\\text{sumfunc}(0)=0.\n\\]\nIntroduce the sequence \\(\\text{convergent}_0,\\text{convergent}_1,\\dots\\) by\n\\[\n\\text{convergent}_0=0,\\qquad\\text{convergent}_1=1,\n\\qquad\\text{convergent}_{\\stepindex}=2\\,\\text{convergent}_{\\stepindex-1}+\\text{convergent}_{\\stepindex-2}\\;(\\stepindex\\ge2).\n\\]\nThis is OEIS A000129; its first few terms are\n\\[\n0,1,2,5,12,29,70,\\dots\n\\]\nand \\(\\text{convergent}_{\\stepindex}\\equiv\\stepindex\\pmod2\\).\n\nThe fractions \\(\\text{convergent}_{\\stepindex-1}/\\text{convergent}_{\\stepindex}\\) are the convergents of the continued-fraction expansion of \\(\\sqrt{2}-1\\).  In particular:\n\\begin{itemize}\n\\item For all \\(\\stepindex\\ge0\\),\n\\[\n\\frac{\\text{convergent}_{2\\stepindex}}{\\text{convergent}_{2\\stepindex+1}}\n<\\sqrt2-1<\n\\frac{\\text{convergent}_{2\\stepindex+1}}{\\text{convergent}_{2\\stepindex+2}}.\n\\]\n\\item No fraction \\(\\numerator/\\denominator\\) with \\(\\denominator<\\text{convergent}_{\\stepindex}+\\text{convergent}_{\\stepindex+1}\\) separates \\(\\sqrt2-1\\) from \\(\\text{convergent}_{\\stepindex}/\\text{convergent}_{\\stepindex-1}\\).  Hence for \\(\\countervar<\\text{convergent}_{\\stepindex}+\\text{convergent}_{\\stepindex+1}\\),\n\\[\n\\lfloor\\countervar(\\sqrt2-1)\\rfloor=\n\\Bigl\\lfloor\\frac{\\countervar\\,\\text{convergent}_{\\stepindex-1}}{\\text{convergent}_{\\stepindex}}\\Bigr\\rfloor\n\\]\nexcept when \\(\\stepindex\\) is even and \\(\\countervar\\in\\{\\text{convergent}_{\\stepindex},2\\,\\text{convergent}_{\\stepindex}\\}\\), in which case the two sides differ by 1.\n\\end{itemize}\n\n\\setcounter{lemma}{0}\n\\begin{lemma}\nLet \\(\\uppbound,\\stepindex\\) be non-negative integers with\n\\(\\text{convergent}_{\\stepindex}\\le\\uppbound<\\text{convergent}_{\\stepindex}+\\text{convergent}_{\\stepindex+1}\\).\n\\begin{enumerate}[\\rm(a)]\n\\item If \\(\\stepindex\\) is even, then\n\\[\\text{sumfunc}(\\uppbound)=\\text{sumfunc}(\\text{convergent}_{\\stepindex})-\n\\text{sumfunc}(\\uppbound-\\text{convergent}_{\\stepindex}).\\]\n\\item If \\(\\stepindex\\) is odd, then\n\\[\\text{sumfunc}(\\uppbound)=\\text{sumfunc}(\\uppbound-\\text{convergent}_{\\stepindex})+1.\\]\n\\end{enumerate}\n\\end{lemma}\n\\begin{proof}\nWe treat part~(a); part~(b) is similar.  Write\n\\begin{align*}\n\\text{sumfunc}(\\uppbound)&=\\text{sumfunc}(\\text{convergent}_{\\stepindex})+\n\\sum_{\\countervar=\\text{convergent}_{\\stepindex}+1}^{\\uppbound}\n(-1)^{\\lfloor\\countervar(\\sqrt2-1)\\rfloor}\\\\[4pt]\n&=\\text{sumfunc}(\\text{convergent}_{\\stepindex})+\n\\sum_{\\countervar=\\text{convergent}_{\\stepindex}+1}^{\\uppbound}\n(-1)^{\\lfloor\\countervar\\,\\text{convergent}_{\\stepindex-1}/\\text{convergent}_{\\stepindex}\\rfloor}+*\\, ,\n\\end{align*}\nwhere \\(*=2\\) if \\(\\uppbound\\ge2\\,\\text{convergent}_{\\stepindex}\\) and \\(*=0\\) otherwise.  Re-indexing gives\n\\[\n\\text{sumfunc}(\\uppbound)=\\text{sumfunc}(\\text{convergent}_{\\stepindex})-\n\\sum_{1}^{\\uppbound-\\text{convergent}_{\\stepindex}}\n(-1)^{\\text{convergent}_{\\stepindex-1}+\\lfloor\\countervar(\\sqrt2-1)\\rfloor}=\\text{sumfunc}(\\text{convergent}_{\\stepindex})-\n\\text{sumfunc}(\\uppbound-\\text{convergent}_{\\stepindex}),\n\\]\nas required.\n\\end{proof}\n\nTaking \\(\\uppbound=\\text{convergent}_{2\\stepindex}\\) in Lemma~1 yields\n\\[\\text{sumfunc}(\\text{convergent}_{2\\stepindex})=\n\\text{sumfunc}(\\text{convergent}_{2\\stepindex}-2\\,\\text{convergent}_{2\\stepindex-1})+2\n=\\text{sumfunc}(\\text{convergent}_{2\\stepindex-2})+2,\\]\nso by induction \\(\\text{sumfunc}(\\text{convergent}_{2\\stepindex})=2\\,\\stepindex\\) for all \\(\\stepindex\\ge0\\).  Another induction on \\(\\uppbound\\) using Lemma~1 now shows\n\\(\\text{sumfunc}(\\uppbound)\\ge0\\) for every non-negative \\(\\uppbound\\), completing the proof.\n\n\\smallskip\\noindent\\textbf{Remark.}\nA097509 (indexed from 0) coincides with \\(\\{\\text{clusterseq}\\}\\) and A276862 (indexed from 1) with \\(\\{\\text{clusterseq}_{\\indexvar-1}\\}\\), confirming a conjecture recorded in the OEIS.\n\n\\smallskip\\noindent\\textbf{Remark.}\nWriting \\(\\text{asequence}(\\uppbound)=\\text{clusterseq}_{\\uppbound+1}\\,(\\uppbound\\ge1)\\) one obtains the description given in OEIS A082844; the details follow exactly the computation leading to \\eqref{eq:2020B6eq2} and are omitted here.\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "a_k": "watermelon",
        "b_i": "strawberry",
        "c_i": "pineapple",
        "h": "sandwich",
        "i": "chocolate",
        "j": "adventure",
        "k": "sunshine",
        "l": "butterfly",
        "m": "espresso",
        "q_j": "telescope",
        "r": "mountains",
        "s": "waterfall",
        "t": "raspberry",
        "a": "elephant",
        "b": "dinosaur",
        "f": "orchestra",
        "K": "labyrinth",
        "n": "kangaroo"
      },
      "question": "Let $kangaroo$ be a positive integer. Prove that\n\\[\n\\sum_{sunshine=1}^{kangaroo} (-1)^{\\lfloor sunshine(\\sqrt{2}-1) \\rfloor} \\geq 0.\n\\]\n(As usual, $\\lfloor x \\rfloor$ denotes the greatest integer less than or equal to $x$.)\n\n\\end{itemize}\n\n\\end{document}",
      "solution": "\\noindent\n\\textbf{First solution.}\nDefine the sequence $\\{watermelon\\}_{sunshine=0}^\\infty$ by $watermelon = \\lfloor sunshine(\\sqrt{2}-1)\\rfloor$. The first few terms of the sequence $\\{(-1)^{watermelon}\\}$ are\n\\[\n1,1,1,-1,-1,1,1,1,-1,-1,1,1,1,\\ldots.\n\\]\nDefine a new sequence $\\{pineapple\\}_{chocolate=0}^\\infty$ given by $3,2,3,2,3,\\ldots$, whose members alternately are the lengths of the clusters of consecutive $1$'s and the lengths of the clusters of consecutive $-1$'s in the sequence $\\{(-1)^{watermelon}\\}$. Then for any $chocolate$, $pineapple_0+\\cdots+pineapple_{chocolate}$ is the number of nonnegative integers $sunshine$ such that $\\lfloor sunshine(\\sqrt{2}-1) \\rfloor$ is strictly less than $chocolate+1$, i.e., such that $sunshine(\\sqrt{2}-1)<chocolate+1$. This last condition is equivalent to $sunshine<(chocolate+1)(\\sqrt{2}+1)$, and we conclude that \\begin{align*}\npineapple_0+\\cdots+pineapple_{chocolate} &= \\lfloor (chocolate+1)(\\sqrt{2}+1)\\rfloor  + 1 \\\\\n&= 2chocolate+3+\\lfloor (chocolate+1)(\\sqrt{2}-1)\\rfloor.\n\\end{align*}\nThus for $chocolate>0$,\n\\begin{equation} \\label{eq:2020B6eq1}\npineapple_{chocolate} =2+\\lfloor (chocolate+1)(\\sqrt{2}-1)\\rfloor-\\lfloor chocolate(\\sqrt{2}-1) \\rfloor.\n\\end{equation}\nNow note that $\\lfloor (chocolate+1)(\\sqrt{2}-1)\\rfloor-\\lfloor chocolate(\\sqrt{2}-1) \\rfloor$ is either $1$ or $0$ depending on whether or not there is an integer $adventure$ between $chocolate(\\sqrt{2}-1)$ and $(chocolate+1)(\\sqrt{2}-1)$: this condition is equivalent to $chocolate<adventure(\\sqrt{2}+1)<chocolate+1$. That is, for $chocolate>0$,\n\\begin{equation} \\label{eq:2020B6eq3}\npineapple_{chocolate} = \\begin{cases} 3 & \\text{if } chocolate=\\lfloor adventure(\\sqrt{2}+1)\\rfloor \\text{ for some integer }adventure, \\\\\n2 &\\text{otherwise};\n\\end{cases}\n\\end{equation}\nby inspection, this also holds for $chocolate=0$.\n\nNow we are asked to prove that\n\\begin{equation}\\label{eq:2020B6eq2}\n\\sum_{sunshine=0}^{kangaroo} (-1)^{watermelon} \\geq 1\n\\end{equation}\nfor all $kangaroo\\geq 1$. We will prove that if \\eqref{eq:2020B6eq2} holds for all $kangaroo\\leq N$, then \\eqref{eq:2020B6eq2} holds for all $kangaroo\\leq 4N$; since \\eqref{eq:2020B6eq2} clearly holds for $kangaroo=1$, this will imply the desired result.\n\nSuppose that \\eqref{eq:2020B6eq2} holds for $kangaroo\\leq N$. To prove that \\eqref{eq:2020B6eq2} holds for $kangaroo\\leq 4N$, it suffices to show that the partial sums\n\\[\n\\sum_{chocolate=0}^{espresso} (-1)^{chocolate} pineapple_{chocolate}\n\\]\nof the sequence $\\{(-1)^{watermelon}\\}$ are positive for all $espresso$ such that $pineapple_0+\\cdots+pineapple_{espresso-1}<4N+3$, since these partial sums cover all clusters through $watermelon_{4N}$. Now if $pineapple_0+\\cdots+pineapple_{espresso-1}<4N+3$, then since each $pineapple_{chocolate}$ is at least $2$, we must have $espresso<2N+2$. From \\eqref{eq:2020B6eq3}, we see that if $espresso$ is odd, then\n\\begin{align*}\n\\sum_{chocolate=0}^{espresso} (-1)^{chocolate} pineapple_{chocolate} &= \\sum_{chocolate=0}^{espresso} (-1)^{chocolate} (pineapple_{chocolate}-2) \\\\\n&= \\sum_{adventure} (-1)^{\\lfloor adventure(\\sqrt{2}+1)\\rfloor} = \\sum_{adventure} (-1)^{watermelon}\n\\end{align*}\nwhere the sum in $adventure$ is over nonnegative integers $adventure$ with $adventure(\\sqrt{2}+1) < espresso$, i.e., $adventure <espresso(\\sqrt{2}-1)$; since $espresso(\\sqrt{2}-1)<espresso/2<N+1$,\n$\\sum_{adventure} (-1)^{watermelon}$ is positive by the induction hypothesis. Similarly, if $espresso$ is even, then $\\sum_{chocolate=0}^{espresso} (-1)^{chocolate} pineapple_{chocolate} = pineapple_{espresso}+ \\sum_{adventure} (-1)^{watermelon}$ and this is again positive by the induction hypothesis. This concludes the induction step and the proof.\n\n\\noindent\n\\textbf{Remark.}\nMore generally, using the same proof we can establish the result with $\\sqrt{2}-1$ replaced by $\\sqrt{kangaroo^2+1}-kangaroo$ for any positive integer $kangaroo$.\n\n\\noindent\n\\textbf{Second solution.}\nFor $kangaroo \\geq 0$, define the function \n\\[\norchestra(kangaroo) = \\sum_{sunshine=1}^{kangaroo} (-1)^{\\lfloor sunshine (\\sqrt{2}-1) \\rfloor}\n\\]\nwith the convention that $orchestra(0) = 0$.\n\nDefine the sequence $telescope_0, telescope_1, \\dots$ by the initial conditions\n\\[\n t\\!elescope_0 = 0,\\; t\\!elescope_1 = 1\n\\]\nand the recurrence relation\n\\[\n\\qquad t\\!elescope_{adventure} = 2\\,t\\!elescope_{adventure-1} + t\\!elescope_{adventure-2}.\n\\]\nThis is OEIS sequence A000129; its first few terms are\n\\[\n0,1,2,5,12,29,70,\\dots.\n\\]\nNote that $t\\!elescope_{adventure} \\equiv adventure \\pmod{2}$.\n\nWe now observe that the fractions $t\\!elescope_{adventure-1}/t\\!elescope_{adventure}$ are the \\emph{convergents} of the continued fraction expansion of $\\sqrt{2}-1$.\nThis implies the following additional properties of the sequence.\n\\begin{itemize}\n\\item\nFor all $adventure \\geq 0$, \n\\[\n\\frac{t\\!elescope_{2adventure}}{t\\!elescope_{2adventure+1}} < \\sqrt{2}-1 < \\frac{t\\!elescope_{2adventure+1}}{t\\!elescope_{2adventure+2}}.\n\\]\n\\item\nThere is no fraction $mountains/waterfall$ with $waterfall < t\\!elescope_{adventure} + t\\!elescope_{adventure+1}$ such that\n$\\frac{mountains}{waterfall}$ separates $\\sqrt{2}-1$ from $t\\!elescope_{adventure}/t\\!elescope_{adventure-1}$. In particular, for $sunshine < t\\!elescope_{adventure} + t\\!elescope_{adventure+1}$,\n\\[\n\\lfloor sunshine (\\sqrt{2}-1) \\rfloor = \\left\\lfloor \\frac{sunshine\\,t\\!elescope_{adventure-1}}{t\\!elescope_{adventure}} \\right\\rfloor\n\\]\nexcept when $adventure$ is even and $sunshine \\in \\{t\\!elescope_{adventure}, 2t\\!elescope_{adventure}\\}$, in which case they differ by 1.\n\\end{itemize}\n\nWe use this to deduce a ``self-similarity'' property of $orchestra(kangaroo)$.\n\\setcounter{lemma}{0}\n\\begin{lemma}\nLet $kangaroo,adventure$ be nonnegative integers with $t\\!elescope_{adventure} \\leq kangaroo < t\\!elescope_{adventure} + t\\!elescope_{adventure+1}$.\n\\begin{itemize}\n\\item[(a)]\nIf $adventure$ is even, then\n\\[\norchestra(kangaroo) = orchestra(t\\!elescope_{adventure}) - orchestra(kangaroo-t\\!elescope_{adventure}).\n\\]\n\\item[(b)]\nIf $adventure$ is odd, then\n\\[\norchestra(kangaroo) = orchestra(kangaroo-t\\!elescope_{adventure}) + 1.\n\\]\n\\end{itemize}\n\\end{lemma}\n\\begin{proof}\nIf $adventure$ is even, then\n\\begin{align*}\norchestra(kangaroo) &= orchestra(t\\!elescope_{adventure}) + \\sum_{sunshine=t\\!elescope_{adventure}+1}^{kangaroo} (-1)^{\\lfloor sunshine(\\sqrt{2}-1) \\rfloor} \\\\\n&= orchestra(t\\!elescope_{adventure}) + \\sum_{sunshine=t\\!elescope_{adventure}+1}^{kangaroo} (-1)^{\\lfloor sunshine\\,t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor} + *\n\\end{align*}\nwhere $*$ equals 2 if $kangaroo \\geq 2t\\!elescope_{adventure}$ (accounting for the term $sunshine = 2t\\!elescope_{adventure}$) and 0 otherwise.\nContinuing,\n\\begin{align*}\norchestra(kangaroo)\n&= orchestra(t\\!elescope_{adventure}) + \\sum_{1}^{kangaroo-t\\!elescope_{adventure}} (-1)^{t\\!elescope_{adventure-1} + \\lfloor sunshine\\,t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor} + * \\\\\n&= orchestra(t\\!elescope_{adventure}) - \\sum_{1}^{kangaroo-t\\!elescope_{adventure}} (-1)^{t\\!elescope_{adventure-1} + \\lfloor sunshine(\\sqrt{2}-1) \\rfloor}\\\\\n&= orchestra(t\\!elescope_{adventure}) - orchestra(kangaroo-t\\!elescope_{adventure}).\n\\end{align*}\nIf $adventure$ is odd, then\n\\begin{align*}\norchestra(kangaroo) &= orchestra(kangaroo-t\\!elescope_{adventure}) + \\sum_{sunshine=kangaroo-t\\!elescope_{adventure}+1}^{kangaroo} (-1)^{\\lfloor sunshine(\\sqrt{2}-1) \\rfloor} \\\\\n&= orchestra(kangaroo-t\\!elescope_{adventure}) -2 + \\sum_{sunshine=kangaroo-t\\!elescope_{adventure}+1}^{kangaroo} (-1)^{\\lfloor sunshine\\,t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor}.\n\\end{align*}\nSince \n\\[\n\\lfloor (sunshine+t\\!elescope_{adventure})t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor \\equiv \\lfloor sunshine\\,t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor \\pmod{2},\n\\]\nwe also have\n\\[\norchestra(kangaroo) = orchestra(kangaroo-t\\!elescope_{adventure}) + \\sum_{sunshine=1}^{t\\!elescope_{adventure}} (-1)^{\\lfloor sunshine\\,t\\!elescope_{adventure-1}/t\\!elescope_{adventure} \\rfloor}.\n\\]\nIn this sum, the summand indexed by $t\\!elescope_{adventure}$ contributes 1, and the summands indexed by $sunshine$ and $t\\!elescope_{adventure}-sunshine$ cancel each other out for \n$sunshine=1,\\dots,t\\!elescope_{adventure}-1$. We thus have\n\\[\norchestra(kangaroo) = orchestra(kangaroo-t\\!elescope_{adventure}) + 1\n\\]\nas claimed.\n\\end{proof}\n\nFrom Lemma~1, we have\n\\[\norchestra(t\\!elescope_{2adventure}) = orchestra(t\\!elescope_{2adventure} - 2t\\!elescope_{2adventure-1}) + 2 = orchestra(t\\!elescope_{2adventure-2}) + 2.\n\\]\nBy induction on $adventure$, $orchestra(t\\!elescope_{2adventure}) = 2adventure$ for all $adventure \\geq 0$;\nby similar logic, we have $orchestra(kangaroo) \\leq orchestra(t\\!elescope_{2adventure}) = 2adventure$ for all $kangaroo \\leq t\\!elescope_{2adventure}$.\nWe can now apply Lemma~1 once more to deduce that $orchestra(kangaroo) \\geq 0$ for all $adventure$.\n\n\\noindent\n\\textbf{Remark.}\nAs a byproduct of the first solution, we confirm the equality of two sequences that were entered separately in the OEIS but conjectured to be equal:\nA097509 (indexed from 0) matches the definition of $\\{pineapple\\}$, while A276862 (indexed from 1)\nmatches the characterization of $\\{pineapple_{chocolate-1}\\}$ given by \\eqref{eq:2020B6eq1}.\n\n\\noindent\n\\textbf{Remark.}\nWe can confirm an additional conjecture from the OEIS by showing that in the notation of the first solution,\nthe sequence $elephant(kangaroo) = pineapple_{kangaroo+1}$ indexed from 1 equals\nA082844: ``Start with 3,2 and apply the rule $elephant(elephant(1)+elephant(2)+\\cdots+elephant(kangaroo)) = elephant(kangaroo)$, fill in any undefined terms with $elephant(t) = 2$ if $elephant(t-1) = 3$ and $elephant(t) = 3$ if $elephant(t-1) = 2$.'' We first verify the recursion. By \\eqref{eq:2020B6eq2},\n\\begin{align*}\nelephant(1) + \\cdots + elephant(kangaroo) &= pineapple_0 + \\cdots + pineapple_{kangaroo+1} - pineapple_0 - pineapple_1 \\\\\n&= \\lfloor (kangaroo+2)(\\sqrt{2}+1) \\rfloor - 4.\n\\end{align*}\nFrom \\eqref{eq:2020B6eq3}, we see that\n$elephant(elephant(1) + \\cdots + elephant(kangaroo)+3) = 3$. Consequently,\nexactly one of $elephant(elephant(1) + \\cdots + elephant(kangaroo))$ or $elephant(elephant(1) + \\cdots + elephant(kangaroo)+1)$ equals 3,\nand it is the former if and only if\n\\[\n\\lfloor (kangaroo+2)(\\sqrt{2}+1) \\rfloor - 3 = \\lfloor (kangaroo+1)(\\sqrt{2}+1) \\rfloor,\n\\]\ni.e., if and only if $elephant(kangaroo) = pineapple_{kangaroo+1} = 3$.\n\nWe next check that the definition correctly fills in values not determined by the recursion. If \n$elephant(kangaroo) = 3$, then $elephant(elephant(1) + \\cdots + elephant(kangaroo)+1) = 2$ because no two consecutive values can both equal 3;\nby the same token, $elephant(kangaroo+1) = 2$ and so there are no further values to fill in. If $elephant(kangaroo) = 2$, then $elephant(elephant(1) + \\cdots + elephant(kangaroo)+1) = 3$ by the previous paragraph;\nthis in turn implies $elephant(elephant(1) + \\cdots + elephant(kangaroo)+2) = 2$, at which point there are no further values to fill in.\n\n\\noindent\n\\textbf{Remark.}\nWe can confirm an additional conjecture from the OEIS by showing that in the notation of the first solution,\nthe sequence $\\{pineapple\\}$ equals\nA245219. This depends on some additional lemmas.\n\\begin{lemma}\nLet $sunshine$ be a positive integer. Then\n\\[\n\\left\\{ chocolate(\\sqrt{2}-1) \\right\\} < \\left\\{ sunshine(\\sqrt{2}-1) \\right\\} \\qquad (chocolate=0,\\dots,sunshine-1)\n\\]\nif and only if $sunshine = t\\!elescope_{2adventure}$ or $sunshine = t\\!elescope_{2adventure}+t\\!elescope_{2adventure-1}$ for some $adventure>0$.\n\\end{lemma}\n\\begin{proof}\n[Proof remains unchanged aside from symbol substitutions.]\n\\end{proof}\n\n[Further lemmas and discussion proceed analogously with the substituted symbols.]\n\n\\end{itemize}\n\\end{document}"
    },
    "descriptive_long_misleading": {
      "map": {
        "a_k": "staticvalue",
        "b_i": "steadynumber",
        "c_i": "fixedgap",
        "h": "bulkamount",
        "i": "wholepart",
        "j": "singleitem",
        "k": "finishline",
        "l": "originpoint",
        "m": "terminalpt",
        "q_j": "sluggishratio",
        "r": "denominator",
        "s": "numerator",
        "t": "spacepoint",
        "a": "nullvalue",
        "b": "emptiness",
        "f": "fixation",
        "K": "variable",
        "n": "infinite"
      },
      "question": "Let $\\infinite$ be a positive integer. Prove that\n\\[\n\\sum_{\\finishline=1}^{\\infinite} (-1)^{\\lfloor \\finishline(\\sqrt{2}-1) \\rfloor} \\geq 0.\n\\]\n(As usual, $\\lfloor x \\rfloor$ denotes the greatest integer less than or equal to $x$.)",
      "solution": "\\noindent\n\\textbf{First solution.}\nDefine the sequence $\\{\\staticvalue\\}_{\\finishline=0}^\\infty$ by $\\staticvalue = \\lfloor \\finishline(\\sqrt{2}-1)\\rfloor$. The first few terms of the sequence $\\{(-1)^{\\staticvalue}\\}$ are\n\\[\n1,1,1,-1,-1,1,1,1,-1,-1,1,1,1,\\ldots.\n\\]\nDefine a new sequence $\\{\\fixedgap\\}_{\\wholepart=0}^\\infty$ given by $3,2,3,2,3,\\ldots$, whose members alternately are the lengths of the clusters of consecutive $1$'s and the lengths of the clusters of consecutive $-1$'s in the sequence $\\{(-1)^{\\staticvalue}\\}$. Then for any $\\wholepart$, $\\fixedgap_0+\\cdots+\\fixedgap_{\\wholepart}$ is the number of nonnegative integers $\\finishline$ such that $\\lfloor \\finishline(\\sqrt{2}-1) \\rfloor$ is strictly less than $\\wholepart+1$, i.e., such that $\\finishline(\\sqrt{2}-1)<\\wholepart+1$. This last condition is equivalent to $\\finishline<(\\wholepart+1)(\\sqrt{2}+1)$, and we conclude that \\begin{align*}\n\\fixedgap_0+\\cdots+\\fixedgap_{\\wholepart} &= \\lfloor (\\wholepart+1)(\\sqrt{2}+1)\\rfloor  + 1 \\\\\n&= 2\\wholepart+3+\\lfloor (\\wholepart+1)(\\sqrt{2}-1)\\rfloor.\n\\end{align*}\nThus for $\\wholepart>0$,\n\\begin{equation} \\label{eq:2020B6eq1}\n\\fixedgap_{\\wholepart} =2+\\lfloor (\\wholepart+1)(\\sqrt{2}-1)\\rfloor-\\lfloor \\wholepart(\\sqrt{2}-1) \\rfloor.\n\\end{equation}\nNow note that $\\lfloor (\\wholepart+1)(\\sqrt{2}-1)\\rfloor-\\lfloor \\wholepart(\\sqrt{2}-1) \\rfloor$ is either $1$ or $0$ depending on whether or not there is an integer $\\singleitem$ between $\\wholepart(\\sqrt{2}-1)$ and $(\\wholepart+1)(\\sqrt{2}-1)$: this condition is equivalent to $\\wholepart<\\singleitem(\\sqrt{2}+1)<\\wholepart+1$. That is, for $\\wholepart>0$,\n\\begin{equation} \\label{eq:2020B6eq3}\n\\fixedgap_{\\wholepart} = \\begin{cases} 3 & \\text{if } \\wholepart=\\lfloor \\singleitem(\\sqrt{2}+1)\\rfloor \\text{ for some integer }\\singleitem, \\\\\n2 &\\text{otherwise};\n\\end{cases}\n\\end{equation}\nby inspection, this also holds for $\\wholepart=0$.\n\nNow we are asked to prove that\n\\begin{equation}\\label{eq:2020B6eq2}\n\\sum_{\\finishline=0}^{\\infinite} (-1)^{\\staticvalue} \\geq 1\n\\end{equation}\nfor all $\\infinite\\geq 1$. We will prove that if \\eqref{eq:2020B6eq2} holds for all $\\infinite\\leq \\infinite_0$, then \\eqref{eq:2020B6eq2} holds for all $\\infinite\\leq 4\\infinite_0$; since \\eqref{eq:2020B6eq2} clearly holds for $\\infinite=1$, this will imply the desired result.\n\nSuppose that \\eqref{eq:2020B6eq2} holds for $\\infinite\\leq \\infinite_0$. To prove that \\eqref{eq:2020B6eq2} holds for $\\infinite\\leq 4\\infinite_0$, it suffices to show that the partial sums\n\\[\n\\sum_{\\wholepart=0}^{\\terminalpt} (-1)^{\\wholepart} \\fixedgap_{\\wholepart}\n\\]\nof the sequence $\\{(-1)^{\\staticvalue}\\}$ are positive for all $\\terminalpt$ such that $\\fixedgap_0+\\cdots+\\fixedgap_{\\terminalpt-1}<4\\infinite_0+3$, since these partial sums cover all clusters through $\\staticvalue_{4\\infinite_0}$. Now if $\\fixedgap_0+\\cdots+\\fixedgap_{\\terminalpt-1}<4\\infinite_0+3$, then since each $\\fixedgap_{\\wholepart}$ is at least $2$, we must have $\\terminalpt<2\\infinite_0+2$. From \\eqref{eq:2020B6eq3}, we see that if $\\terminalpt$ is odd, then\n\\begin{align*}\n\\sum_{\\wholepart=0}^{\\terminalpt} (-1)^{\\wholepart} \\fixedgap_{\\wholepart} &= \\sum_{\\wholepart=0}^{\\terminalpt} (-1)^{\\wholepart} (\\fixedgap_{\\wholepart}-2) \\\\\n&= \\sum_{\\singleitem} (-1)^{\\lfloor \\singleitem(\\sqrt{2}+1)\\rfloor} = \\sum_{\\singleitem} (-1)^{\\staticvalue}\n\\end{align*}\nwhere the sum in $\\singleitem$ is over nonnegative integers $\\singleitem$ with $\\singleitem(\\sqrt{2}+1) < \\terminalpt$, i.e., $\\singleitem <\\terminalpt(\\sqrt{2}-1)$; since $\\terminalpt(\\sqrt{2}-1)<\\terminalpt/2<\\infinite_0+1$,\n$\\sum_{\\singleitem} (-1)^{\\staticvalue}$ is positive by the induction hypothesis. Similarly, if $\\terminalpt$ is even, then $\\sum_{\\wholepart=0}^{\\terminalpt} (-1)^{\\wholepart} \\fixedgap_{\\wholepart} = \\fixedgap_{\\terminalpt}+ \\sum_{\\singleitem} (-1)^{\\staticvalue}$ and this is again positive by the induction hypothesis. This concludes the induction step and the proof.\n\n\\noindent\n\\textbf{Remark.}\nMore generally, using the same proof we can establish the result with $\\sqrt{2}-1$ replaced by $\\sqrt{\\infinite^2+1}-\\infinite$ for any positive integer $\\infinite$.\n\n\\medskip\n\\noindent\n\\textbf{Second solution.}\nFor $\\infinite \\geq 0$, define the function \n\\[\n\\fixation(\\infinite) = \\sum_{\\finishline=1}^{\\infinite} (-1)^{\\lfloor \\finishline (\\sqrt{2}-1) \\rfloor}\n\\]\nwith the convention that $\\fixation(0) = 0$.\n\nDefine the sequence $\\sluggishratio_0, \\sluggishratio_1, \\dots$ by the initial conditions\n\\[\n\\sluggishratio_0 = 0, \\sluggishratio_1 = 1\n\\]\nand the recurrence relation\n\\[\n\\qquad \\sluggishratio_{\\singleitem} = 2\\sluggishratio_{\\singleitem-1} + \\sluggishratio_{\\singleitem-2}.\n\\]\nThis is OEIS sequence A000129; its first few terms are\n\\[\n0,1,2,5,12,29,70,\\dots.\n\\]\nNote that $\\sluggishratio_{\\singleitem} \\equiv \\singleitem \\pmod{2}$.\n\nWe now observe that the fractions $\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem}$ are the \\emph{convergents} of the continued fraction expansion of $\\sqrt{2}-1$.\nThis implies the following additional properties of the sequence.\n\\begin{itemize}\n\\item\nFor all $\\singleitem \\geq 0$, \n\\[\n\\frac{\\sluggishratio_{2\\singleitem}}{\\sluggishratio_{2\\singleitem+1}} < \\sqrt{2}-1 < \\frac{\\sluggishratio_{2\\singleitem+1}}{\\sluggishratio_{2\\singleitem+2}}.\n\\]\n\\item\nThere is no fraction $\\denominator/\\numerator$ with $\\numerator < \\sluggishratio_{\\singleitem} + \\sluggishratio_{\\singleitem+1}$ such that\n$\\frac{\\denominator}{\\numerator}$ separates $\\sqrt{2}-1$ from $\\sluggishratio_{\\singleitem}/\\sluggishratio_{\\singleitem-1}$. In particular, for $\\finishline < \\sluggishratio_{\\singleitem} + \\sluggishratio_{\\singleitem+1}$,\n\\[\n\\lfloor \\finishline (\\sqrt{2}-1) \\rfloor = \\left\\lfloor \\frac{\\finishline\\sluggishratio_{\\singleitem-1}}{\\sluggishratio_{\\singleitem}} \\right\\rfloor\n\\]\nexcept when $\\singleitem$ is even and $\\finishline \\in \\{\\sluggishratio_{\\singleitem}, 2\\sluggishratio_{\\singleitem}\\}$, in which case they differ by 1.\n\\end{itemize}\n\nWe use this to deduce a ``self-similarity'' property of $\\fixation(\\infinite)$.\n\\setcounter{lemma}{0}\n\\begin{lemma}\nLet $\\infinite,\\singleitem$ be nonnegative integers with $\\sluggishratio_{\\singleitem} \\leq \\infinite < \\sluggishratio_{\\singleitem} + \\sluggishratio_{\\singleitem+1}$.\n\\begin{itemize}\n\\item[(a)]\nIf $\\singleitem$ is even, then\n\\[\n\\fixation(\\infinite) = \\fixation(\\sluggishratio_{\\singleitem}) - \\fixation(\\infinite-\\sluggishratio_{\\singleitem}).\n\\]\n\\item[(b)]\nIf $\\singleitem$ is odd, then\n\\[\n\\fixation(\\infinite) = \\fixation(\\infinite-\\sluggishratio_{\\singleitem}) + 1.\n\\]\n\\end{itemize}\n\\end{lemma}\n\\begin{proof}\nIf $\\singleitem$ is even, then\n\\begin{align*}\n\\fixation(\\infinite) &= \\fixation(\\sluggishratio_{\\singleitem}) + \\sum_{\\finishline=\\sluggishratio_{\\singleitem}+1}^{\\infinite} (-1)^{\\lfloor \\finishline(\\sqrt{2}-1) \\rfloor} \\\\\n&= \\fixation(\\sluggishratio_{\\singleitem}) + \\sum_{\\finishline=\\sluggishratio_{\\singleitem}+1}^{\\infinite} (-1)^{\\lfloor \\finishline\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor} + *\n\\end{align*}\nwhere $*$ equals 2 if $\\infinite \\geq 2\\sluggishratio_{\\singleitem}$ (accounting for the term $\\finishline = 2\\sluggishratio_{\\singleitem}$) and 0 otherwise.\nContinuing,\n\\begin{align*}\n\\fixation(\\infinite)\n&= \\fixation(\\sluggishratio_{\\singleitem}) + \\sum_{1}^{\\infinite-\\sluggishratio_{\\singleitem}} (-1)^{\\sluggishratio_{\\singleitem-1} + \\lfloor \\finishline\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor} + * \\\\\n&= \\fixation(\\sluggishratio_{\\singleitem}) - \\sum_{1}^{\\infinite-\\sluggishratio_{\\singleitem}} (-1)^{\\sluggishratio_{\\singleitem-1} + \\lfloor \\finishline(\\sqrt{2}-1) \\rfloor}\\\\\n&= \\fixation(\\sluggishratio_{\\singleitem}) - \\fixation(\\infinite-\\sluggishratio_{\\singleitem}).\n\\end{align*}\nIf $\\singleitem$ is odd, then\n\\begin{align*}\n\\fixation(\\infinite) &= \\fixation(\\infinite-\\sluggishratio_{\\singleitem}) + \\sum_{\\finishline=\\infinite-\\sluggishratio_{\\singleitem}+1}^{\\infinite} (-1)^{\\lfloor \\finishline(\\sqrt{2}-1) \\rfloor} \\\\\n&= \\fixation(\\infinite-\\sluggishratio_{\\singleitem}) -2 + \\sum_{\\finishline=\\infinite-\\sluggishratio_{\\singleitem}+1}^{\\infinite} (-1)^{\\lfloor \\finishline\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor}.\n\\end{align*}\nSince \n\\[\n\\lfloor (\\finishline+\\sluggishratio_{\\singleitem})\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor \\equiv \\lfloor \\finishline\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor \\pmod{2},\n\\]\nwe also have\n\\[\n\\fixation(\\infinite) = \\fixation(\\infinite-\\sluggishratio_{\\singleitem}) + \\sum_{\\finishline=1}^{\\sluggishratio_{\\singleitem}} (-1)^{\\lfloor \\finishline\\sluggishratio_{\\singleitem-1}/\\sluggishratio_{\\singleitem} \\rfloor}.\n\\]\nIn this sum, the summand indexed by $\\sluggishratio_{\\singleitem}$ contributes 1, and the summands indexed by $\\finishline$ and $\\sluggishratio_{\\singleitem}-\\finishline$ cancel each other out for \n$\\finishline=1,\\dots,\\sluggishratio_{\\singleitem}-1$. We thus have\n\\[\n\\fixation(\\infinite) = \\fixation(\\infinite-\\sluggishratio_{\\singleitem}) + 1\n\\]\nas claimed.\n\\end{proof}\n\nFrom Lemma~1, we have\n\\[\n\\fixation(\\sluggishratio_{2\\singleitem}) = \\fixation(\\sluggishratio_{2\\singleitem} - 2\\sluggishratio_{2\\singleitem-1}) + 2 = \\fixation(\\sluggishratio_{2\\singleitem-2}) + 2.\n\\]\nBy induction on $\\singleitem$, $\\fixation(\\sluggishratio_{2\\singleitem}) = 2\\singleitem$ for all $\\singleitem \\geq 0$;\nby similar logic, we have $\\fixation(\\infinite) \\leq \\fixation(\\sluggishratio_{2\\singleitem}) = 2\\singleitem$ for all $\\infinite \\leq \\sluggishratio_{2\\singleitem}$.\nWe can now apply Lemma~1 once more to deduce that $\\fixation(\\infinite) \\geq 0$ for all $\\singleitem$.\n\n\\noindent\n\\textbf{Remark.}\nAs a byproduct of the first solution, we confirm the equality of two sequences that were entered separately in the OEIS but conjectured to be equal:\nA097509 (indexed from 0) matches the definition of $\\{\\fixedgap\\}$, while A276862 (indexed from 1)\nmatches the characterization of $\\{\\fixedgap_{\\wholepart-1}\\}$ given by \\eqref{eq:2020B6eq1}.\n\n\\noindent\n\\textbf{Remark.}\nWe can confirm an additional conjecture from the OEIS by showing that in the notation of the first solution,\nthe sequence $\\nullvalue(\\infinite) = \\fixedgap_{\\infinite+1}$ indexed from 1 equals\nA082844: ``Start with 3,2 and apply the rule $\\nullvalue(\\nullvalue(1)+\\nullvalue(2)+\\cdots+\\nullvalue(\\infinite)) = \\nullvalue(\\infinite)$, fill in any undefined terms with $\\nullvalue(\\spacepoint) = 2$ if $\\nullvalue(\\spacepoint-1) = 3$ and $\\nullvalue(\\spacepoint) = 3$ if $\\nullvalue(\\spacepoint-1) = 2$.'' We first verify the recursion. By \\eqref{eq:2020B6eq2},\n\\begin{align*}\n\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite) &= \\fixedgap_0 + \\cdots + \\fixedgap_{\\infinite+1} - \\fixedgap_0 - \\fixedgap_1 \\\\\n&= \\lfloor (\\infinite+2)(\\sqrt{2}+1) \\rfloor - 4.\n\\end{align*}\nFrom \\eqref{eq:2020B6eq3}, we see that\n$\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite)+3) = 3$. Consequently,\nexactly one of $\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite))$ or $\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite)+1)$ equals 3,\nand it is the former if and only if\n\\[\n\\lfloor (\\infinite+2)(\\sqrt{2}+1) \\rfloor - 3 = \\lfloor (\\infinite+1)(\\sqrt{2}+1) \\rfloor,\n\\]\ni.e., if and only if $\\nullvalue(\\infinite) = \\fixedgap_{\\infinite+1} = 3$.\n\nWe next check that the definition correctly fills in values not determined by the recursion. If \n$\\nullvalue(\\infinite) = 3$, then $\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite)+1) = 2$ because no two consecutive values can both equal 3;\nby the same token, $\\nullvalue(\\infinite+1) = 2$ and so there are no further values to fill in. If $\\nullvalue(\\infinite) = 2$, then $\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite)+1) = 3$ by the previous paragraph;\nthis in turn implies $\\nullvalue(\\nullvalue(1) + \\cdots + \\nullvalue(\\infinite)+2) = 2$, at which point there are no further values to fill in.\n"
    },
    "garbled_string": {
      "map": {
        "a_k": "qzxwvtnp",
        "b_i": "hjgrksla",
        "c_i": "mndplxfb",
        "h": "skvdrome",
        "i": "plqshvrc",
        "j": "fzmbwrna",
        "k": "dvjqplse",
        "l": "rgmnsvta",
        "m": "xqplbrta",
        "q_j": "cwjdnkra",
        "r": "lqmsvbrd",
        "s": "nljqvbts",
        "t": "prgxmlsw",
        "a": "brxplqzn",
        "b": "zjktpwhs",
        "f": "glhzrpct",
        "K": "vczsmrla",
        "n": "tdgvbzma"
      },
      "question": "Let $tdgvbzma$ be a positive integer. Prove that\n\\[\n\\sum_{dvjqplse=1}^{tdgvbzma} (-1)^{\\lfloor dvjqplse(\\sqrt{2}-1) \\rfloor} \\geq 0.\n\\]\n(As usual, $\\lfloor x \\rfloor$ denotes the greatest integer less than or equal to $x$.)",
      "solution": "\\noindent\n\\textbf{First solution.}\nDefine the sequence $\\{qzxwvtnp\\}_{dvjqplse=0}^\\infty$ by $qzxwvtnp = \\lfloor dvjqplse(\\sqrt{2}-1)\\rfloor$. The first few terms of the sequence $\\{(-1)^{qzxwvtnp}\\}$ are\n\\[\n1,1,1,-1,-1,1,1,1,-1,-1,1,1,1,\\ldots.\n\\]\nDefine a new sequence $\\{mndplxfb\\}_{plqshvrc=0}^\\infty$ given by $3,2,3,2,3,\\ldots$, whose members alternately are the lengths of the clusters of consecutive $1$'s and the lengths of the clusters of consecutive $-1$'s in the sequence $\\{(-1)^{qzxwvtnp}\\}$. Then for any $plqshvrc$, $c_0+\\cdots+c_{plqshvrc}$ is the number of non-negative integers $dvjqplse$ such that $\\lfloor dvjqplse(\\sqrt{2}-1) \\rfloor$ is strictly less than $plqshvrc+1$, i.e.\n$dvjqplse(\\sqrt{2}-1)<plqshvrc+1$. This last condition is equivalent to $dvjqplse<(plqshvrc+1)(\\sqrt{2}+1)$, and we conclude that\n\\begin{align*}\nc_0+\\cdots+c_{plqshvrc} &= \\lfloor (plqshvrc+1)(\\sqrt{2}+1)\\rfloor  + 1 \\\\\n&= 2plqshvrc+3+\\lfloor (plqshvrc+1)(\\sqrt{2}-1)\\rfloor.\n\\end{align*}\nThus for $plqshvrc>0$,\n\\begin{equation} \\label{eq:2020B6eq1}\nmndplxfb =2+\\lfloor (plqshvrc+1)(\\sqrt{2}-1)\\rfloor-\\lfloor plqshvrc(\\sqrt{2}-1) \\rfloor.\n\\end{equation}\nNow note that $\\lfloor (plqshvrc+1)(\\sqrt{2}-1)\\rfloor-\\lfloor plqshvrc(\\sqrt{2}-1) \\rfloor$ is either $1$ or $0$ depending on whether or not there is an integer $fzmbwrna$ between $plqshvrc(\\sqrt{2}-1)$ and $(plqshvrc+1)(\\sqrt{2}-1)$: this condition is equivalent to $plqshvrc<fzmbwrna(\\sqrt{2}+1)<plqshvrc+1$. That is, for $plqshvrc>0$,\n\\begin{equation} \\label{eq:2020B6eq3}\nmndplxfb = \\begin{cases} 3 & \\text{if } plqshvrc=\\lfloor fzmbwrna(\\sqrt{2}+1)\\rfloor \\text{ for some integer }fzmbwrna, \\\\ 2 &\\text{otherwise};\\end{cases}\n\\end{equation}\nby inspection, this also holds for $plqshvrc=0$.\n\nNow we are asked to prove that\n\\begin{equation}\\label{eq:2020B6eq2}\n\\sum_{dvjqplse=0}^{tdgvbzma} (-1)^{qzxwvtnp} \\geq 1\n\\end{equation}\nfor all $tdgvbzma\\geq 1$. We will prove that if \\eqref{eq:2020B6eq2} holds for all $tdgvbzma\\leq N$, then \\eqref{eq:2020B6eq2} holds for all $tdgvbzma\\leq 4N$; since \\eqref{eq:2020B6eq2} clearly holds for $tdgvbzma=1$, this will imply the desired result.\n\nSuppose that \\eqref{eq:2020B6eq2} holds for $tdgvbzma\\leq N$. To prove that \\eqref{eq:2020B6eq2} holds for $tdgvbzma\\leq 4N$, it suffices to show that the partial sums\n\\[\n\\sum_{plqshvrc=0}^{xqplbrta} (-1)^{plqshvrc} c_{plqshvrc}\n\\]\nof the sequence $\\{(-1)^{qzxwvtnp}\\}$ are positive for all $xqplbrta$ such that $c_0+\\cdots+c_{xqplbrta-1}<4N+3$, since these partial sums cover all clusters through $a_{4N}$. Now if $c_0+\\cdots+c_{xqplbrta-1}<4N+3$, then since each $c_{plqshvrc}$ is at least $2$, we must have $xqplbrta<2N+2$. From \\eqref{eq:2020B6eq3}, we see that if $xqplbrta$ is odd, then\n\\begin{align*}\n\\sum_{plqshvrc=0}^{xqplbrta} (-1)^{plqshvrc} c_{plqshvrc} &= \\sum_{plqshvrc=0}^{xqplbrta} (-1)^{plqshvrc} (c_{plqshvrc}-2) \\\\\n&= \\sum_{fzmbwrna} (-1)^{\\lfloor fzmbwrna(\\sqrt{2}+1)\\rfloor} = \\sum_{fzmbwrna} (-1)^{a_{fzmbwrna}}\n\\end{align*}\nwhere the sum in $fzmbwrna$ is over non-negative integers $fzmbwrna$ with $fzmbwrna(\\sqrt{2}+1) < xqplbrta$, i.e.\n$fzmbwrna <xqplbrta(\\sqrt{2}-1)$; since $xqplbrta(\\sqrt{2}-1)<xqplbrta/2<N+1$, $\\sum_{fzmbwrna} (-1)^{a_{fzmbwrna}}$ is positive by the induction hypothesis. Similarly, if $xqplbrta$ is even, then $\\sum_{plqshvrc=0}^{xqplbrta} (-1)^{plqshvrc} c_{plqshvrc} = c_{xqplbrta}+ \\sum_{fzmbwrna} (-1)^{a_{fzmbwrna}}$ and this is again positive by the induction hypothesis.\nThis concludes the induction step and the proof.\n\n\\noindent\\textbf{Remark.}\nMore generally, using the same proof we can establish the result with $\\sqrt{2}-1$ replaced by $\\sqrt{tdgvbzma^2+1}-tdgvbzma$ for any positive integer $tdgvbzma$.\n\n\\noindent\\textbf{Second solution.}\nFor $tdgvbzma \\geq 0$, define the function\n\\[\nglhzrpct(tdgvbzma) = \\sum_{dvjqplse=1}^{tdgvbzma} (-1)^{\\lfloor dvjqplse (\\sqrt{2}-1) \\rfloor}\n\\]\nwith the convention that $glhzrpct(0)=0$.\n\nDefine the sequence $q_0,q_1,\\dots$ by the initial conditions $q_0=0,\\;q_1=1$ and the recurrence relation $q_{fzmbwrna}=2q_{fzmbwrna-1}+q_{fzmbwrna-2}$.  This is OEIS sequence A000129.  One checks that $q_{fzmbwrna}\\equiv fzmbwrna\\pmod{2}$.\n\nThe fractions $q_{fzmbwrna-1}/q_{fzmbwrna}$ are the convergents of the continued-fraction expansion of $\\sqrt{2}-1$.  From their basic properties one shows:\n\\begin{itemize}\n\\item For all $fzmbwrna\\ge0$, $\\displaystyle\\frac{q_{2fzmbwrna}}{q_{2fzmbwrna+1}}<\\sqrt{2}-1<\\frac{q_{2fzmbwrna+1}}{q_{2fzmbwrna+2}}$.\n\\item If $nljqvbts<q_{fzmbwrna}+q_{fzmbwrna+1}$ then\n      $\\lfloor nljqvbts(\\sqrt{2}-1)\\rfloor=\\bigl\\lfloor \\dfrac{nljqvbts q_{fzmbwrna-1}}{q_{fzmbwrna}}\\bigr\\rfloor$\n      except when $fzmbwrna$ is even and $nljqvbts\\in\\{q_{fzmbwrna},2q_{fzmbwrna}\\}$.\n\\end{itemize}\nThese give the following “self-similarity” of $glhzrpct$.\n\n\\begin{lemma}\nLet $tdgvbzma,fzmbwrna\\ge0$ with $q_{fzmbwrna}\\le tdgvbzma<q_{fzmbwrna}+q_{fzmbwrna+1}$.  Then\n\\begin{itemize}\n\\item[(a)] If $fzmbwrna$ is even, $glhzrpct(tdgvbzma)=glhzrpct(q_{fzmbwrna})-glhzrpct(tdgvbzma-q_{fzmbwrna})$.\n\\item[(b)] If $fzmbwrna$ is odd,  $glhzrpct(tdgvbzma)=glhzrpct(tdgvbzma-q_{fzmbwrna})+1$.\n\\end{itemize}\n\\end{lemma}\nA routine induction using the lemma gives $glhzrpct(q_{2fzmbwrna})=2fzmbwrna$ and hence $glhzrpct(tdgvbzma)\\ge0$ for every $tdgvbzma$.\n\n\\noindent\\textbf{Remarks.}\n\\begin{itemize}\n\\item The first solution shows that the cluster-length sequence $\\{mndplxfb\\}$ is OEIS A097509; A276862 coincides with the shifted sequence $\\{mndplxfb_{plqshvrc-1}\\}$.\n\\item Setting $brxplqzn(tdgvbzma)=mndplxfb_{tdgvbzma+1}$ yields OEIS A082844, verifying another conjecture.\n\\item A further analysis (omitted here) identifies $\\{mndplxfb\\}$ with OEIS A245219 via several auxiliary lemmas about palindromic prefixes and continued-fraction expansions.\n\\end{itemize}"
    },
    "kernel_variant": {
      "question": "Let n be a positive integer. Prove that\n\n          n\n          ∑   (−1)^{⌊k(√5−2)⌋}  ≥  0 .\n         k=1\n\n(As usual, ⌊x⌋ denotes the greatest integer less than or equal to x.)",
      "solution": "Throughout put\na := √5 − 2  ≈ 0.2360679… ,  b := 1/a = √5 + 2 = 4 + a ≈ 4.2360679… .\nFor k ≥ 1 set\n  A_k := ⌊ka⌋ ,  s_k := (−1)^{A_k},  S(n) := Σ_{k=1}^{n} s_k (n ≥ 1).\nOur goal is to prove S(n) ≥ 0 for every n ∈ ℕ.\n\n0.  Blocks of equal signs.\nBecause a < 1/3, the sequence (s_k) is constant for four or five consecutive\nindices; we call such a maximal string a “block”.  Denote the lengths of the\nsuccessive blocks by\n  c_i := ⌊(i+1)b⌋ − ⌊ib⌋  (i = 0,1,2,…).\nSince 4 < b < 5 we have c_i ∈ {4,5}.  Write\n  c_i = 4 + d_i  (d_i ∈ {0,1}).\nThus d_i = 1  ⇔  c_i = 5.\n\n1.  Where do the long blocks occur?\nWe have\n  c_i = 5  ⇔  {ib} > 1 − a  ⇔  i = ⌊kb⌋\nfor some k ≥ 1; i.e. the indices with d_i = 1 form the Beatty sequence ⌊kb⌋.\nTwo immediate consequences are useful.\n\nFact 1   (no two 5’s in a row).\nBecause 2b = 8 + 2a < 9 we have\n  c_i + c_{i+1} = ⌊(i+2)b⌋ − ⌊ib⌋ ∈ {8,9},\nso c_i and c_{i+1} cannot both equal 5.  Hence d_i + d_{i+1} ≤ 1.\n\nFact 2   (parity correspondence).\nSince b = 4 + a we can write\n  ⌊kb⌋ = 4k + ⌊ka⌋.\nConsequently\n  ⌊kb⌋ even  ⇔  ⌊ka⌋ even,  ⌊kb⌋ odd  ⇔  ⌊ka⌋ odd.  (1)\n\n2.  Alternating block sums.\nDefine\n  T_i := Σ_{j=0}^{i} (−1)^j c_j  (i = 0,1,2,…).\nEvery partial sum S(n) ends somewhere inside a block; if this block has index m\nand we are r places into it (1 ≤ r ≤ c_m), then\n  S(n) = T_{m−1} + (−1)^m r.  (2)\nThus it suffices to show T_i ≥ 0 for every i.\n\nSplit c_j = 4 + d_j and put\n  D_i := Σ_{j=0}^{i} (−1)^j d_j.\nThen\n  T_i = 4 Σ_{j=0}^{i} (−1)^j + D_i =\n  { 4 + D_i  (i even),\n  {  D_i    (i odd).          (3)\nHence proving D_i ≥ 0 for all i immediately yields\n  T_{2m} ≥ 4 and T_{2m+1} ≥ 0;\nand then (2) gives S(n) ≥ 0.  From now on we concentrate on D_i.\n\n3.  Re-expressing D_i through earlier S(·).\nRecall that d_j = 1 exactly when j = ⌊kb⌋.  Therefore\n  D_i = Σ_{j=0}^{i} (−1)^j d_j = Σ_{k : ⌊kb⌋ ≤ i} (−1)^{⌊kb⌋}\n    = Σ_{k=1}^{M(i)} (−1)^{⌊kb⌋},\nwhere M(i) := ⌊(i+1)/b⌋ (because ⌊kb⌋ ≤ i  ⇔  kb < i+1).\nUsing (1) we obtain (−1)^{⌊kb⌋} = (−1)^{⌊ka⌋}; hence\n  D_i = Σ_{k=1}^{M(i)} (−1)^{⌊ka⌋} = S(M(i)).  (4)\nBecause b > 4 we have M(i) ≤ ⌊(i+1)/4⌋ < i for every i ≥ 5.\nThus each D_i equals an earlier partial sum S(·) taken at a strictly smaller\nindex.\n\n4.  Induction on n.\nWe prove by strong induction on n ≥ 1 that S(n) ≥ 0.\n\nBase values 1 ≤ n ≤ 5.\nCompute A_k = ⌊ka⌋ for k ≤ 5:\n A_1,…,A_5 = 0,0,0,0,1.\nHence s_1,…,s_5 = +1,+1,+1,+1,−1 and\n S(1)…S(5) = 1,2,3,4,3,\nall non-negative.  (The first sign change occurs already at k = 5.)\n\nInduction step.\nAssume S(t) ≥ 0 for all t < n with n ≥ 6.  Let the block containing n have\nindex m and let r be as in (2).\n\n•  m even.\n Then (−1)^m = +1 and S(n) ≥ T_{m−1}.  Here m−1 is odd, so by (3)\n  T_{m−1} = D_{m−1} = S(M(m−1)) ≥ 0\n because M(m−1) < m−1 < n and the induction hypothesis applies.\n\n•  m odd.\n Then (−1)^m = −1 and S(n) = T_{m−1} − r.  Now m−1 is even, so (3) gives\n  T_{m−1} = 4 + D_{m−1} ≥ 4.\n Also r ≤ c_m ≤ 5.  For odd m we have\n  T_m = T_{m−1} − c_m = D_m = S(M(m)) ≥ 0\n again by the induction hypothesis (since M(m) < n).  Consequently\n  T_{m−1} ≥ c_m ≥ r,\n so S(n) = T_{m−1} − r ≥ 0.\n\nIn both cases S(n) ≥ 0, completing the induction.  Therefore\n  Σ_{k=1}^{n} (−1)^{⌊k(√5−2)⌋} ≥ 0 for every n ∈ ℕ. ∎",
      "_meta": {
        "core_steps": [
          "Group consecutive terms with the same sign; let c_i be the lengths of these sign-blocks.",
          "Show that each c_i equals either 2 or 3, with the pattern determined by the Beatty sequence ⌊j(√2+1)⌋.",
          "Rewrite the target inequality as positivity of the alternating partial sums Σ_{i=0}^m (–1)^i c_i.",
          "Induct: assume these alternating sums are positive up to N; use the facts c_i∈{2,3} and a mapping c_i–2 ↔ earlier (–1)^{⌊kα⌋} terms to extend the bound from N to 4N.",
          "Check the base case (n=1) to complete the induction and hence the inequality for all n."
        ],
        "mutable_slots": {
          "slot_alpha": {
            "description": "The irrational constant multiplied by k inside the floor function.",
            "original": "√2 − 1"
          },
          "slot_cluster_lengths": {
            "description": "The two possible sizes of same-sign blocks produced in step 1.",
            "original": "2 and 3"
          },
          "slot_scale_factor": {
            "description": "The expansion factor (N → 4N) used in the induction step.",
            "original": "4"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}