{
  "index": "2015-A-2",
  "type": "NT",
  "tag": [
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "Let $a_0=1$, $a_1=2$, and $a_n=4a_{n-1}-a_{n-2}$ for $n\\geq 2$. Find an odd prime factor of $a_{2015}$.",
  "solution": "\\noindent\n\\textbf{First solution:}\nOne possible answer is $181$.\nBy induction, we have $a_n = ((2+\\sqrt{3})^n+(2-\\sqrt{3})^n)/2 = (\\alpha^n+\\beta^n)/2$ for all $n$, where $\\alpha = 2+\\sqrt{3}$ and $\\beta = 2-\\sqrt{3}$. Now note that if $k$ is an odd positive integer and $a_n \\neq 0$, then\n$\\frac{a_{kn}}{a_n} = \\frac{\\alpha^{kn}+\\beta^{kn}}{\\alpha^n+\\beta^n}\n= \\alpha^{(k-1)n}-\\alpha^{(k-2)n}\\beta^n+\\cdots-\\alpha^n\\beta^{(k-2)n}+\\beta^{(k-1)n}$.\nThis expression is both rational (because $a_n$ and $a_{kn}$ are integers) and of the form $a+b\\sqrt{3}$ for some integers $a,b$ by the expressions for $\\alpha,\\beta$; it follows that it must be an integer, and so $a_{kn}$ is divisible by $a_n$. Applying this to $n=5$ and $k=403$, we find that $a_{2015}$ is divisible by $a_5 = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Second solution:}\nBy rewriting the formula for $a_n$ as $a_{n-2} = 4a_{n-1} - a_n$, we may extend the sequence backwards to define $a_n$ for all integers $n$. Since $a_{-1} = 2$, we may see by induction that $a_{-n} = a_n$ for all $n$. For any integer $m$ and any prime $p$ dividing $a_m$,\n$p$ also divides $a_{-m}$; on the other hand, $p$ cannot divide $a_{-m+1}$, as otherwise $p$ would also divide $a_{-m+2}, \\dots, a_0 = 1$, a contradiction. We can thus find an integer $k$ such that $a_{m+1} \\equiv k a_{-m+1} \\pmod{p}$; by induction on $n$, we see that\n$a_n \\equiv k a_{n-2m} \\pmod{p}$ for all $n$. In particular, if $k$ is odd, then $p$ also divides $a_{km}$; we thus conclude (again) that $a_{2015}$ is divisible by $a_5 = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Remark:}\nAlthough it was not needed in the solution, we note in passing that if $a_n \\equiv 0 \\pmod{p}$, then $a_{2n+k} \\equiv -a_{k} \\pmod{p}$ for all $k$.\n\n\\noindent\n\\textbf{Remark:} One can find other odd prime factors of $a_{2015}$ in the same manner. For example, $a_{2015}$ is divisible by each of the following quantities. (The prime factorizations were computed using\nthe \\texttt{Magma} computer algebra system.)\n\\begin{align*}\na_{13} &= 2 \\times 6811741 \\\\\na_{31} &= 2 \\times 373 \\times 360250962984637 \\\\\na_{5 \\cdot 13} &= 2 \\times 181 \\times 6811741 \\\\\n&\\quad \\times 3045046274679316654761356161 \\\\\na_{5 \\cdot 31} &= 1215497709121 \\times 28572709494917432101 \\\\\n&\\quad \\times\n13277360555506179816997827126375881581 \\\\\na_{13 \\cdot 31} &= 2 \\times 373 \\times 193441 \\times 6811741 \\times 360250962984637 \\\\\n&\\quad \\times 16866100753000669 \\\\\n&\\quad \\times 79988387992470656916594531961 \\times p_{156}\n\\end{align*}\nwhere $p_{156}$ is a prime of 156 decimal digits. Dividing $a_{2015}$ by the product of the primes appearing in this list yields a number $N$ of 824 decimal digits which is definitely not prime, because $2^N \\not\\equiv 2 \\pmod{N}$, but whose prime factorization we have been unable to establish. Note that $N$ is larger than a 2048-bit RSA modulus, so the difficulty of factoring it is not surprising.\n\nOne thing we can show is that each prime factor of $N$ is %divisible by \ncongruent to $1$ modulo \n$6 \\times 2015 = 12090$, thanks to the following lemma.\n\n\\begin{lemma*}\nLet $n$ be an odd integer. Then any odd prime factor $p$ of $a_n$ which does not divide $a_m$ for any divisor $m$ of $n$ is congruent to $1$ modulo $\\lcm(6,n)$. (By either solution of the original problem, $p$ also does not divide $a_m$ for any positive integer $m<n$.)\n\\end{lemma*}\n\\begin{proof}\nWe first check that $p \\equiv 1 \\pmod{3}$.\nIn $\\FF_q = \\FF_p(\\sqrt{3})$ we have $(\\alpha/\\beta)^n \\equiv -1$. If $p \\equiv 2 \\pmod{3}$,\nthen $q = p^2$ and $\\alpha$ and $\\beta$ are conjugate in $p$; consequently, the equality\n$\\alpha^n = -\\beta^n$ in $\\FF_{q^2}$ means that $\\alpha^n = c \\sqrt{3}$, $\\beta^n = - c \\sqrt{3}$ for some $c \\in \\FF_p$. But then $-3c^2 = \\alpha^n \\beta^n = 1$ in $\\FF_q$ and hence in $\\FF_p$, which contradicts $p \\equiv 2 \\pmod{3}$ by quadratic reciprocity.\n\nBy the previous paragraph, $\\alpha$ and $\\beta$ may be identified with elements of $\\FF_p$, and we have $(\\alpha/\\beta)^n \\equiv -1$, but the same does not hold with $n$ replaced by any smaller value. Since $\\FF_p^\\times$ is a cyclic group of order $p-1$, this forces $p \\equiv 1 \\pmod{n}$ as claimed.\n\\end{proof}",
  "vars": [
    "n",
    "k",
    "m",
    "p",
    "q",
    "N",
    "c"
  ],
  "params": [
    "a_0",
    "a_1",
    "a_n",
    "a_n-1",
    "a_n-2",
    "a_kn",
    "a_5",
    "a_2015",
    "a_-1",
    "a_-n",
    "a_-m",
    "a_-m+1",
    "a_-m+2",
    "a_m+1",
    "a_n-2m",
    "a_km",
    "a_2n+k",
    "a_k",
    "a_13",
    "a_31",
    "a_5\\\\cdot13",
    "a_5\\\\cdot31",
    "a_13\\\\cdot31",
    "a_m",
    "\\\\alpha",
    "\\\\beta"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "indexvar",
        "k": "oddmulti",
        "m": "anyindex",
        "p": "primevar",
        "q": "fieldorder",
        "N": "biginteger",
        "c": "scalarfield",
        "a_0": "seqzero",
        "a_1": "seqone",
        "a_n": "seqgeneral",
        "a_n-1": "seqprev",
        "a_n-2": "seqprevtwo",
        "a_kn": "seqkn",
        "a_5": "seqfive",
        "a_2015": "seqtwothousandfifteen",
        "a_-1": "seqnegone",
        "a_-n": "seqnegindex",
        "a_-m": "seqnegany",
        "a_-m+1": "seqneganyplusone",
        "a_-m+2": "seqneganyplustwo",
        "a_m+1": "sequenceanyplusone",
        "a_n-2m": "seqtwomless",
        "a_km": "seqkm",
        "a_2n+k": "seqtwonplusk",
        "a_k": "seqk",
        "a_13": "seqthirteen",
        "a_31": "seqthirtyone",
        "a_5\\cdot13": "seqfivebythirteen",
        "a_5\\cdot31": "seqfivebythirtyone",
        "a_13\\cdot31": "seqthirteenbythirtyone",
        "a_m": "sequenceany",
        "\\alpha": "rootalpha",
        "\\beta": "rootbeta"
      },
      "question": "Let $seqzero=1$, $seqone=2$, and $seqgeneral=4seqprev-seqprevtwo$ for $indexvar\\geq 2$. Find an odd prime factor of $seqtwothousandfifteen$.",
      "solution": "\\noindent\\textbf{First solution:}\\ One possible answer is $181$.\\nBy induction, we have $seqgeneral = ((2+\\sqrt{3})^{indexvar}+(2-\\sqrt{3})^{indexvar})/2 = (rootalpha^{indexvar}+rootbeta^{indexvar})/2$ for all $indexvar$, where $rootalpha = 2+\\sqrt{3}$ and $rootbeta = 2-\\sqrt{3}$. Now note that if $oddmulti$ is an odd positive integer and $seqgeneral \\neq 0$, then\\n\\[\\frac{seqkn}{seqgeneral} = \\frac{rootalpha^{oddmulti\\,indexvar}+rootbeta^{oddmulti\\,indexvar}}{rootalpha^{indexvar}+rootbeta^{indexvar}} = rootalpha^{(oddmulti-1)indexvar}-rootalpha^{(oddmulti-2)indexvar}rootbeta^{indexvar}+\\cdots-rootalpha^{indexvar}rootbeta^{(oddmulti-2)indexvar}+rootbeta^{(oddmulti-1)indexvar}.\\]\\nThis expression is both rational (because $seqgeneral$ and $seqkn$ are integers) and of the form $a+b\\sqrt{3}$ for some integers $a,b$ by the expressions for $rootalpha,rootbeta$; it follows that it must be an integer, and so $seqkn$ is divisible by $seqgeneral$. Applying this to $indexvar=5$ and $oddmulti=403$, we find that $seqtwothousandfifteen$ is divisible by $seqfive = 362$ and thus by $181$.\\n\\noindent\\textbf{Second solution:}\\ By rewriting the formula for $seqgeneral$ as $seqprevtwo = 4seqprev - seqgeneral$, we may extend the sequence backwards to define $seqgeneral$ for all integers $indexvar$. Since $seqnegone = 2$, we may see by induction that $seqnegindex = seqgeneral$ for all $indexvar$. For any integer $anyindex$ and any prime $primevar$ dividing $sequenceany$, $primevar$ also divides $seqnegany$; on the other hand, $primevar$ cannot divide $seqneganyplusone$, as otherwise $primevar$ would also divide $seqneganyplustwo, \\dots, seqzero = 1$, a contradiction. We can thus find an integer $oddmulti$ such that $sequenceanyplusone \\equiv oddmulti\\,seqneganyplusone \\pmod{primevar}$; by induction on $indexvar$, we see that $seqgeneral \\equiv oddmulti\\,seqtwomless \\pmod{primevar}$ for all $indexvar$. In particular, if $oddmulti$ is odd, then $primevar$ also divides $seqkm$; we thus conclude (again) that $seqtwothousandfifteen$ is divisible by $seqfive = 362$ and thus by $181$.\\n\\noindent\\textbf{Remark:}\\ Although it was not needed in the solution, we note in passing that if $seqgeneral \\equiv 0 \\pmod{primevar}$, then $seqtwonplusk \\equiv -seqk \\pmod{primevar}$ for all $seqk$.\\n\\noindent\\textbf{Remark:}\\ One can find other odd prime factors of $seqtwothousandfifteen$ in the same manner. For example, $seqtwothousandfifteen$ is divisible by each of the following quantities. (The prime factorizations were computed using the \\texttt{Magma} computer algebra system.)\\n\\begin{align*} seqthirteen &= 2 \\times 6811741 \\\\ seqthirtyone &= 2 \\times 373 \\times 360250962984637 \\\\ seqfivebythirteen &= 2 \\times 181 \\times 6811741 \\\\ &\\quad \\times 3045046274679316654761356161 \\\\ seqfivebythirtyone &= 1215497709121 \\times 28572709494917432101 \\\\ &\\quad \\times 13277360555506179816997827126375881581 \\\\ seqthirteenbythirtyone &= 2 \\times 373 \\times 193441 \\times 6811741 \\times 360250962984637 \\\\ &\\quad \\times 16866100753000669 \\\\ &\\quad \\times 79988387992470656916594531961 \\times primevar_{156} \\end{align*}\\nwhere $primevar_{156}$ is a prime of 156 decimal digits. Dividing $seqtwothousandfifteen$ by the product of the primes appearing in this list yields a number $biginteger$ of 824 decimal digits which is definitely not prime, because $2^{biginteger} \\not\\equiv 2 \\pmod{biginteger}$, but whose prime factorization we have been unable to establish. Note that $biginteger$ is larger than a 2048-bit RSA modulus, so the difficulty of factoring it is not surprising.\\n\\nOne thing we can show is that each prime factor of $biginteger$ is congruent to $1$ modulo $6 \\times 2015 = 12090$, thanks to the following lemma.\\n\\begin{lemma*} Let $indexvar$ be an odd integer. Then any odd prime factor $primevar$ of $seqgeneral$ which does not divide $sequenceany$ for any divisor $anyindex$ of $indexvar$ is congruent to $1$ modulo $\\lcm(6,indexvar)$. (By either solution of the original problem, $primevar$ also does not divide $sequenceany$ for any positive integer $anyindex<indexvar$.) \\end{lemma*}\\n\\begin{proof} We first check that $primevar \\equiv 1 \\pmod{3}$. In $\\FF_{fieldorder} = \\FF_{primevar}(\\sqrt{3})$ we have $(rootalpha/rootbeta)^{indexvar} \\equiv -1$. If $primevar \\equiv 2 \\pmod{3}$, then $fieldorder = primevar^2$ and $rootalpha$ and $rootbeta$ are conjugate in $primevar$; consequently, the equality $rootalpha^{indexvar} = -rootbeta^{indexvar}$ in $\\FF_{fieldorder^2}$ means that $rootalpha^{indexvar} = scalarfield \\sqrt{3}$, $rootbeta^{indexvar} = - scalarfield \\sqrt{3}$ for some $scalarfield \\in \\FF_{primevar}$. But then $-3scalarfield^2 = rootalpha^{indexvar} rootbeta^{indexvar} = 1$ in $\\FF_{fieldorder}$ and hence in $\\FF_{primevar}$, which contradicts $primevar \\equiv 2 \\pmod{3}$ by quadratic reciprocity.\\n\\nBy the previous paragraph, $rootalpha$ and $rootbeta$ may be identified with elements of $\\FF_{primevar}$, and we have $(rootalpha/rootbeta)^{indexvar} \\equiv -1$, but the same does not hold with $indexvar$ replaced by any smaller value. Since $\\FF_{primevar}^\\times$ is a cyclic group of order $primevar-1$, this forces $primevar \\equiv 1 \\pmod{indexvar}$ as claimed. \\end{proof}"
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "lanternfish",
        "k": "beanstalk",
        "m": "starflower",
        "p": "cloudberry",
        "q": "bramblebush",
        "N": "dragonfruit",
        "c": "buttercup",
        "a_0": "windmill",
        "a_1": "pineapple",
        "a_n": "sandcastle",
        "a_{n-1}": "thesparrow",
        "a_{n-2}": "copperleaf",
        "a_{kn}": "rainshower",
        "a_5": "brickhouse",
        "a_{2015}": "honeybadger",
        "a_{-1}": "jellybeans",
        "a_{-n}": "lumberjack",
        "a_{-m}": "backpacker",
        "a_{-m+1}": "riverstone",
        "a_{-m+2}": "mothership",
        "a_{m+1}": "sugarcane",
        "a_{n-2m}": "fencepost",
        "a_{km}": "lighthouse",
        "a_{2n+k}": "chameleon",
        "a_k": "spicebloom",
        "a_{13}": "suncatcher",
        "a_{31}": "blueberry",
        "a_{5 \\cdot 13}": "dragonfly",
        "a_{5 \\cdot 31}": "firecracker",
        "a_{13 \\cdot 31}": "woodpecker",
        "a_m": "papercrane",
        "\\alpha": "cinnamon",
        "\\beta": "peppermint"
      },
      "question": "Let $windmill=1$, $pineapple=2$, and $sandcastle=4\\,thesparrow-copperleaf$ for $lanternfish\\geq 2$. Find an odd prime factor of $honeybadger$.",
      "solution": "\\noindent\n\\textbf{First solution:}\nOne possible answer is $181$.\nBy induction, we have $sandcastle = ((2+\\sqrt{3})^{lanternfish}+(2-\\sqrt{3})^{lanternfish})/2 = (cinnamon^{lanternfish}+peppermint^{lanternfish})/2$ for all $lanternfish$, where $cinnamon = 2+\\sqrt{3}$ and $peppermint = 2-\\sqrt{3}$. Now note that if $beanstalk$ is an odd positive integer and $sandcastle \\neq 0$, then\n$\\frac{rainshower}{sandcastle} = \\frac{cinnamon^{beanstalk\\,lanternfish}+peppermint^{beanstalk\\,lanternfish}}{cinnamon^{lanternfish}+peppermint^{lanternfish}}\n= cinnamon^{(beanstalk-1)lanternfish}-cinnamon^{(beanstalk-2)lanternfish}\\,peppermint^{lanternfish}+\\cdots-cinnamon^{lanternfish}\\,peppermint^{(beanstalk-2)lanternfish}+peppermint^{(beanstalk-1)lanternfish}$.\nThis expression is both rational (because $sandcastle$ and $rainshower$ are integers) and of the form $a+b\\sqrt{3}$ for some integers $a,b$ by the expressions for $cinnamon,peppermint$; it follows that it must be an integer, and so $rainshower$ is divisible by $sandcastle$. Applying this to $lanternfish=5$ and $beanstalk=403$, we find that $honeybadger$ is divisible by $brickhouse = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Second solution:}\nBy rewriting the formula for $sandcastle$ as $copperleaf = 4\\,thesparrow - sandcastle$, we may extend the sequence backwards to define $sandcastle$ for all integers $lanternfish$. Since $jellybeans = 2$, we may see by induction that $lumberjack = sandcastle$ for all $lanternfish$. For any integer $starflower$ and any prime $cloudberry$ dividing $papercrane$,\n$cloudberry$ also divides $backpacker$; on the other hand, $cloudberry$ cannot divide $riverstone$, as otherwise $cloudberry$ would also divide $mothership, \\dots, windmill = 1$, a contradiction. We can thus find an integer $beanstalk$ such that $sugarcane \\equiv beanstalk\\,riverstone \\pmod{cloudberry}$; by induction on $lanternfish$, we see that\n$sandcastle \\equiv beanstalk\\,fencepost \\pmod{cloudberry}$ for all $lanternfish$. In particular, if $beanstalk$ is odd, then $cloudberry$ also divides $lighthouse$; we thus conclude (again) that $honeybadger$ is divisible by $brickhouse = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Remark:}\nAlthough it was not needed in the solution, we note in passing that if $sandcastle \\equiv 0 \\pmod{cloudberry}$, then $chameleon \\equiv -spicebloom \\pmod{cloudberry}$ for all $spicebloom$.\n\n\\noindent\n\\textbf{Remark:} One can find other odd prime factors of $honeybadger$ in the same manner. For example, $honeybadger$ is divisible by each of the following quantities. (The prime factorizations were computed using the \\texttt{Magma} computer algebra system.)\n\\begin{align*}\nsuncatcher &= 2 \\times 6811741 \\\\\nblueberry &= 2 \\times 373 \\times 360250962984637 \\\\\ndragonfly &= 2 \\times 181 \\times 6811741 \\\\\n&\\quad \\times 3045046274679316654761356161 \\\\\nfirecracker &= 1215497709121 \\times 28572709494917432101 \\\\\n&\\quad \\times 13277360555506179816997827126375881581 \\\\\nwoodpecker &= 2 \\times 373 \\times 193441 \\times 6811741 \\times 360250962984637 \\\\\n&\\quad \\times 16866100753000669 \\\\\n&\\quad \\times 79988387992470656916594531961 \\times cloudberry_{156}\n\\end{align*}\nwhere $cloudberry_{156}$ is a prime of 156 decimal digits. Dividing $honeybadger$ by the product of the primes appearing in this list yields a number $dragonfruit$ of 824 decimal digits which is definitely not prime, because $2^{dragonfruit} \\not\\equiv 2 \\pmod{dragonfruit}$, but whose prime factorization we have been unable to establish. Note that $dragonfruit$ is larger than a 2048-bit RSA modulus, so the difficulty of factoring it is not surprising.\n\nOne thing we can show is that each prime factor of $dragonfruit$ is congruent to $1$ modulo $6 \\times 2015 = 12090$, thanks to the following lemma.\n\n\\begin{lemma*}\nLet $lanternfish$ be an odd integer. Then any odd prime factor $cloudberry$ of $sandcastle$ which does not divide $papercrane$ for any divisor $starflower$ of $lanternfish$ is congruent to $1$ modulo $\\lcm(6,lanternfish)$. (By either solution of the original problem, $cloudberry$ also does not divide $papercrane$ for any positive integer $starflower<lanternfish$.)\n\\end{lemma*}\n\\begin{proof}\nWe first check that $cloudberry \\equiv 1 \\pmod{3}$.\nIn $\\FF_{bramblebush} = \\FF_{cloudberry}(\\sqrt{3})$ we have $(cinnamon/peppermint)^{lanternfish} \\equiv -1$. If $cloudberry \\equiv 2 \\pmod{3}$, then $bramblebush = cloudberry^2$ and $cinnamon$ and $peppermint$ are conjugate in $cloudberry$; consequently, the equality $cinnamon^{lanternfish} = -peppermint^{lanternfish}$ in $\\FF_{bramblebush^2}$ means that $cinnamon^{lanternfish} = buttercup \\sqrt{3}$, $peppermint^{lanternfish} = - buttercup \\sqrt{3}$ for some $buttercup \\in \\FF_{cloudberry}$. But then $-3buttercup^2 = cinnamon^{lanternfish} peppermint^{lanternfish} = 1$ in $\\FF_{bramblebush}$ and hence in $\\FF_{cloudberry}$, which contradicts $cloudberry \\equiv 2 \\pmod{3}$ by quadratic reciprocity.\n\nBy the previous paragraph, $cinnamon$ and $peppermint$ may be identified with elements of $\\FF_{cloudberry}$, and we have $(cinnamon/peppermint)^{lanternfish} \\equiv -1$, but the same does not hold with $lanternfish$ replaced by any smaller value. Since $\\FF_{cloudberry}^{\\times}$ is a cyclic group of order $cloudberry-1$, this forces $cloudberry \\equiv 1 \\pmod{lanternfish}$ as claimed.\n\\end{proof}"
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "constantindex",
        "k": "evenindex",
        "m": "primeindex",
        "p": "compositeprime",
        "q": "nonfieldvalue",
        "N": "tinyvalue",
        "c": "unknownvalue",
        "a_0": "seqfinalzero",
        "a_{0}": "seqfinalzero",
        "a_1": "seqfinalone",
        "a_{1}": "seqfinalone",
        "a_n": "seqconstantindex",
        "a_{n}": "seqconstantindex",
        "a_n-1": "seqconstantindexminusone",
        "a_{n-1}": "seqconstantindexminusone",
        "a_n-2": "seqconstantindexminustwo",
        "a_{n-2}": "seqconstantindexminustwo",
        "a_kn": "seqconstantevenindexconstantindex",
        "a_{kn}": "seqconstantevenindexconstantindex",
        "a_5": "seqconstantfive",
        "a_{5}": "seqconstantfive",
        "a_2015": "seqconstanttwothousandfifteen",
        "a_{2015}": "seqconstanttwothousandfifteen",
        "a_-1": "seqconstantnegone",
        "a_{-1}": "seqconstantnegone",
        "a_-n": "seqconstantnegconstantindex",
        "a_{-n}": "seqconstantnegconstantindex",
        "a_-m": "seqconstantnegprimeindex",
        "a_{-m}": "seqconstantnegprimeindex",
        "a_-m+1": "seqconstantnegprimeindexplusone",
        "a_{-m+1}": "seqconstantnegprimeindexplusone",
        "a_-m+2": "seqconstantnegprimeindexplustwo",
        "a_{-m+2}": "seqconstantnegprimeindexplustwo",
        "a_m+1": "seqconstantprimeindexplusone",
        "a_{m+1}": "seqconstantprimeindexplusone",
        "a_n-2m": "seqconstantindexminustwoprimeindex",
        "a_{n-2m}": "seqconstantindexminustwoprimeindex",
        "a_km": "seqconstantevenindexprimeindex",
        "a_{km}": "seqconstantevenindexprimeindex",
        "a_2n+k": "seqconstanttwiceindexplusevenindex",
        "a_{2n+k}": "seqconstanttwiceindexplusevenindex",
        "a_k": "seqconstantevenindex",
        "a_{k}": "seqconstantevenindex",
        "a_13": "seqconstantthirteen",
        "a_{13}": "seqconstantthirteen",
        "a_31": "seqconstantthirtyone",
        "a_{31}": "seqconstantthirtyone",
        "a_5\\cdot13": "seqconstantfivebythirteen",
        "a_{5 \\cdot 13}": "seqconstantfivebythirteen",
        "a_5\\cdot31": "seqconstantfivebythirtyone",
        "a_{5 \\cdot 31}": "seqconstantfivebythirtyone",
        "a_13\\cdot31": "seqconstantthirteenbythirtyone",
        "a_{13 \\cdot 31}": "seqconstantthirteenbythirtyone",
        "a_m": "seqconstantprimeindex",
        "a_{m}": "seqconstantprimeindex",
        "\\alpha": "greekomega",
        "\\beta": "greekgamma",
        "p_{156}": "compositeprime_{156}"
      },
      "question": "Let $seqfinalzero=1$, $seqfinalone=2$, and $seqconstantindex=4seqconstantindexminusone-seqconstantindexminustwo$ for $constantindex\\geq 2$. Find an odd prime factor of $seqconstanttwothousandfifteen$.",
      "solution": "\\noindent\n\\textbf{First solution:}\nOne possible answer is $181$.\nBy induction, we have $seqconstantindex = ((2+\\sqrt{3})^{constantindex}+(2-\\sqrt{3})^{constantindex})/2 = (greekomega^{constantindex}+greekgamma^{constantindex})/2$ for all $constantindex$, where $greekomega = 2+\\sqrt{3}$ and $greekgamma = 2-\\sqrt{3}$. Now note that if $evenindex$ is an odd positive integer and $seqconstantindex \\neq 0$, then\n$\\frac{seqconstantevenindexconstantindex}{seqconstantindex} = \\frac{greekomega^{evenindex constantindex}+greekgamma^{evenindex constantindex}}{greekomega^{constantindex}+greekgamma^{constantindex}}\n= greekomega^{(evenindex-1) constantindex}-greekomega^{(evenindex-2) constantindex}greekgamma^{constantindex}+\\cdots-greekomega^{constantindex}greekgamma^{(evenindex-2) constantindex}+greekgamma^{(evenindex-1) constantindex}$.\nThis expression is both rational (because $seqconstantindex$ and $seqconstantevenindexconstantindex$ are integers) and of the form $a+b\\sqrt{3}$ for some integers $a,b$ by the expressions for $greekomega,greekgamma$; it follows that it must be an integer, and so $seqconstantevenindexconstantindex$ is divisible by $seqconstantindex$. Applying this to $constantindex=5$ and $evenindex=403$, we find that $seqconstanttwothousandfifteen$ is divisible by $seqconstantfive = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Second solution:}\nBy rewriting the formula for $seqconstantindex$ as $seqconstantindexminustwo = 4seqconstantindexminusone - seqconstantindex$, we may extend the sequence backwards to define $seqconstantindex$ for all integers $constantindex$. Since $seqconstantnegone = 2$, we may see by induction that $seqconstantnegconstantindex = seqconstantindex$ for all $constantindex$. For any integer $primeindex$ and any prime $compositeprime$ dividing $seqconstantprimeindex$, $compositeprime$ also divides $seqconstantnegprimeindex$; on the other hand, $compositeprime$ cannot divide $seqconstantnegprimeindexplusone$, as otherwise $compositeprime$ would also divide $seqconstantnegprimeindexplustwo, \\dots, seqfinalzero = 1$, a contradiction. We can thus find an integer $evenindex$ such that $seqconstantprimeindexplusone \\equiv evenindex \\, seqconstantnegprimeindexplusone \\pmod{compositeprime}$; by induction on $constantindex$, we see that $seqconstantindex \\equiv evenindex \\, seqconstantindexminustwoprimeindex \\pmod{compositeprime}$ for all $constantindex$. In particular, if $evenindex$ is odd, then $compositeprime$ also divides $seqconstantevenindexprimeindex$; we thus conclude (again) that $seqconstanttwothousandfifteen$ is divisible by $seqconstantfive = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Remark:}\nAlthough it was not needed in the solution, we note in passing that if $seqconstantindex \\equiv 0 \\pmod{compositeprime}$, then $seqconstanttwiceindexplusevenindex \\equiv -seqconstantevenindex \\pmod{compositeprime}$ for all $evenindex$.\n\n\\noindent\n\\textbf{Remark:} One can find other odd prime factors of $seqconstanttwothousandfifteen$ in the same manner. For example, $seqconstanttwothousandfifteen$ is divisible by each of the following quantities. (The prime factorizations were computed using the \\texttt{Magma} computer algebra system.)\n\\begin{align*}\nseqconstantthirteen &= 2 \\times 6811741 \\\\\nseqconstantthirtyone &= 2 \\times 373 \\times 360250962984637 \\\\\nseqconstantfivebythirteen &= 2 \\times 181 \\times 6811741 \\\\\n&\\quad \\times 3045046274679316654761356161 \\\\\nseqconstantfivebythirtyone &= 1215497709121 \\times 28572709494917432101 \\\\\n&\\quad \\times 13277360555506179816997827126375881581 \\\\\nseqconstantthirteenbythirtyone &= 2 \\times 373 \\times 193441 \\times 6811741 \\times 360250962984637 \\\\\n&\\quad \\times 16866100753000669 \\\\\n&\\quad \\times 79988387992470656916594531961 \\times compositeprime_{156}\n\\end{align*}\nwhere $compositeprime_{156}$ is a prime of 156 decimal digits. Dividing $seqconstanttwothousandfifteen$ by the product of the primes appearing in this list yields a number tinyvalue of 824 decimal digits which is definitely not prime, because $2^{tinyvalue} \\not\\equiv 2 \\pmod{tinyvalue}$, but whose prime factorization we have been unable to establish. Note that tinyvalue is larger than a 2048-bit RSA modulus, so the difficulty of factoring it is not surprising.\n\nOne thing we can show is that each prime factor of tinyvalue is congruent to $1$ modulo $6 \\times 2015 = 12090$, thanks to the following lemma.\n\n\\begin{lemma*}\nLet $constantindex$ be an odd integer. Then any odd prime factor $compositeprime$ of $seqconstantindex$ which does not divide $seqconstantprimeindex$ for any divisor $primeindex$ of $constantindex$ is congruent to $1$ modulo $\\lcm(6,constantindex)$. (By either solution of the original problem, $compositeprime$ also does not divide $seqconstantprimeindex$ for any positive integer $primeindex<constantindex$.)\n\\end{lemma*}\n\\begin{proof}\nWe first check that $compositeprime \\equiv 1 \\pmod{3}$.\nIn $\\FF_{nonfieldvalue} = \\FF_{compositeprime}(\\sqrt{3})$ we have $(greekomega/greekgamma)^{constantindex} \\equiv -1$. If $compositeprime \\equiv 2 \\pmod{3}$, then $nonfieldvalue = compositeprime^2$ and $greekomega$ and $greekgamma$ are conjugate in $compositeprime$; consequently, the equality $greekomega^{constantindex} = -greekgamma^{constantindex}$ in $\\FF_{nonfieldvalue^2}$ means that $greekomega^{constantindex} = unknownvalue \\sqrt{3}$, $greekgamma^{constantindex} = - unknownvalue \\sqrt{3}$ for some $unknownvalue \\in \\FF_{compositeprime}$. But then $-3 unknownvalue^2 = greekomega^{constantindex} greekgamma^{constantindex} = 1$ in $\\FF_{nonfieldvalue}$ and hence in $\\FF_{compositeprime}$, which contradicts $compositeprime \\equiv 2 \\pmod{3}$ by quadratic reciprocity.\n\nBy the previous paragraph, $greekomega$ and $greekgamma$ may be identified with elements of $\\FF_{compositeprime}$, and we have $(greekomega/greekgamma)^{constantindex} \\equiv -1$, but the same does not hold with $constantindex$ replaced by any smaller value. Since $\\FF_{compositeprime}^\\times$ is a cyclic group of order $compositeprime-1$, this forces $compositeprime \\equiv 1 \\pmod{constantindex}$ as claimed.\n\\end{proof}"
    },
    "garbled_string": {
      "map": {
        "n": "zqkmytgh",
        "k": "pldrasoe",
        "m": "wucbjfne",
        "p": "hdislawq",
        "q": "mbtofyar",
        "N": "grlsneed",
        "c": "vakthopi",
        "a_0": "lprxgove",
        "a_1": "zbonfuca",
        "a_n": "jfrblexm",
        "a_n-1": "ytodkemi",
        "a_n-2": "sqnypleb",
        "a_kn": "vljkeqwr",
        "a_5": "mpaxftoe",
        "a_2015": "gnhosoae",
        "a_-1": "dxevugra",
        "a_-n": "aserkovy",
        "a_-m": "tiszfleq",
        "a_-m+1": "pnufqbja",
        "a_-m+2": "hgjwktse",
        "a_m+1": "grapaycu",
        "a_n-2m": "jixrseam",
        "a_km": "dmesvilo",
        "a_2n+k": "fobxmari",
        "a_k": "rhqallow",
        "a_13": "ofsradke",
        "a_31": "whoxemlu",
        "a_5\\\\cdot13": "izoytnav",
        "a_5\\\\cdot31": "bvekqami",
        "a_13\\\\cdot31": "hgxpcrid",
        "a_m": "adrkvype",
        "\\alpha": "olbdqnar",
        "\\beta": "ivuhecma"
      },
      "question": "Let $lprxgove=1$, $zbonfuca=2$, and $jfrblexm=4ytodkemi-sqnypleb$ for $zqkmytgh\\geq 2$. Find an odd prime factor of $gnhosoae$.",
      "solution": "\\noindent\n\\textbf{First solution:}\nOne possible answer is $181$.\nBy induction, we have $jfrblexm = ((2+\\sqrt{3})^{zqkmytgh}+(2-\\sqrt{3})^{zqkmytgh})/2 = (olbdqnar^{zqkmytgh}+ivuhecma^{zqkmytgh})/2$ for all $zqkmytgh$, where $olbdqnar = 2+\\sqrt{3}$ and $ivuhecma = 2-\\sqrt{3}$. Now note that if $pldrasoe$ is an odd positive integer and $jfrblexm \\neq 0$, then\n$\\frac{vljkeqwr}{jfrblexm} = \\frac{olbdqnar^{pldrasoe zqkmytgh}+ivuhecma^{pldrasoe zqkmytgh}}{olbdqnar^{zqkmytgh}+ivuhecma^{zqkmytgh}}\n= olbdqnar^{(pldrasoe-1)zqkmytgh}-olbdqnar^{(pldrasoe-2)zqkmytgh}ivuhecma^{zqkmytgh}+\\cdots-olbdqnar^{zqkmytgh}ivuhecma^{(pldrasoe-2)zqkmytgh}+ivuhecma^{(pldrasoe-1)zqkmytgh}$.\nThis expression is both rational (because $jfrblexm$ and $vljkeqwr$ are integers) and of the form $a+b\\sqrt{3}$ for some integers $a,b$ by the expressions for $olbdqnar,ivuhecma$; it follows that it must be an integer, and so $vljkeqwr$ is divisible by $jfrblexm$. Applying this to $zqkmytgh=5$ and $pldrasoe=403$, we find that $gnhosoae$ is divisible by $mpaxftoe = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Second solution:}\nBy rewriting the formula for $jfrblexm$ as $sqnypleb = 4ytodkemi - jfrblexm$, we may extend the sequence backwards to define $jfrblexm$ for all integers $zqkmytgh$. Since $dxevugra = 2$, we may see by induction that $aserkovy = jfrblexm$ for all $zqkmytgh$. For any integer $wucbjfne$ and any prime $hdislawq$ dividing $adrkvype$,\n$hdislawq$ also divides $tiszfleq$; on the other hand, $hdislawq$ cannot divide $pnufqbja$, as otherwise $hdislawq$ would also divide $hgjwktse, \\dots, lprxgove = 1$, a contradiction. We can thus find an integer $pldrasoe$ such that $grapaycu \\equiv pldrasoe\\, pnufqbja \\pmod{hdislawq}$; by induction on $zqkmytgh$, we see that\n$jfrblexm \\equiv pldrasoe\\, jixrseam \\pmod{hdislawq}$ for all $zqkmytgh$. In particular, if $pldrasoe$ is odd, then $hdislawq$ also divides $dmesvilo$; we thus conclude (again) that $gnhosoae$ is divisible by $mpaxftoe = 362$ and thus by $181$.\n\n\\noindent\n\\textbf{Remark:}\nAlthough it was not needed in the solution, we note in passing that if $jfrblexm \\equiv 0 \\pmod{hdislawq}$, then $fobxmari \\equiv -rhqallow \\pmod{hdislawq}$ for all $pldrasoe$.\n\n\\noindent\n\\textbf{Remark:} One can find other odd prime factors of $gnhosoae$ in the same manner. For example, $gnhosoae$ is divisible by each of the following quantities. (The prime factorizations were computed using\n\\texttt{Magma} computer algebra system.)\n\\begin{align*}\nofsradke &= 2 \\times 6811741 \\\\\nwhoxemlu &= 2 \\times 373 \\times 360250962984637 \\\\\nizoytnav &= 2 \\times 181 \\times 6811741 \\\\\n&\\quad \\times 3045046274679316654761356161 \\\\\nbvekqami &= 1215497709121 \\times 28572709494917432101 \\\\\n&\\quad \\times\n13277360555506179816997827126375881581 \\\\\nhgxpcrid &= 2 \\times 373 \\times 193441 \\times 6811741 \\times 360250962984637 \\\\\n&\\quad \\times 16866100753000669 \\\\\n&\\quad \\times 79988387992470656916594531961 \\times hdislawq_{156}\n\\end{align*}\nwhere $hdislawq_{156}$ is a prime of 156 decimal digits. Dividing $gnhosoae$ by the product of the primes appearing in this list yields a number grlsneed of 824 decimal digits which is definitely not prime, because $2^{grlsneed} \\not\\equiv 2 \\pmod{grlsneed}$, but whose prime factorization we have been unable to establish. Note that grlsneed is larger than a 2048-bit RSA modulus, so the difficulty of factoring it is not surprising.\n\nOne thing we can show is that each prime factor of grlsneed is congruent to $1$ modulo \n$6 \\times 2015 = 12090$, thanks to the following lemma.\n\n\\begin{lemma*}\nLet $zqkmytgh$ be an odd integer. Then any odd prime factor $hdislawq$ of $jfrblexm$ which does not divide $adrkvype$ for any divisor $wucbjfne$ of $zqkmytgh$ is congruent to $1$ modulo $\\lcm(6,zqkmytgh)$. (By either solution of the original problem, $hdislawq$ also does not divide $adrkvype$ for any positive integer $wucbjfne<zqkmytgh$.)\n\\end{lemma*}\n\\begin{proof}\nWe first check that $hdislawq \\equiv 1 \\pmod{3}$.\nIn $\\FF_{mbtofyar} = \\FF_{hdislawq}(\\sqrt{3})$ we have $(olbdqnar/ivuhecma)^{zqkmytgh} \\equiv -1$. If $hdislawq \\equiv 2 \\pmod{3}$,\nthen $mbtofyar = hdislawq^2$ and $olbdqnar$ and $ivuhecma$ are conjugate in $hdislawq$; consequently, the equality\n$olbdqnar^{zqkmytgh} = -ivuhecma^{zqkmytgh}$ in $\\FF_{mbtofyar^2}$ means that $olbdqnar^{zqkmytgh} = vakthopi \\sqrt{3}$, $ivuhecma^{zqkmytgh} = - vakthopi \\sqrt{3}$ for some $vakthopi \\in \\FF_{hdislawq}$. But then $-3vakthopi^2 = olbdqnar^{zqkmytgh} ivuhecma^{zqkmytgh} = 1$ in $\\FF_{mbtofyar}$ and hence in $\\FF_{hdislawq}$, which contradicts $hdislawq \\equiv 2 \\pmod{3}$ by quadratic reciprocity.\n\nBy the previous paragraph, $olbdqnar$ and $ivuhecma$ may be identified with elements of $\\FF_{hdislawq}$, and we have $(olbdqnar/ivuhecma)^{zqkmytgh} \\equiv -1$, but the same does not hold with $zqkmytgh$ replaced by any smaller value. Since $\\FF_{hdislawq}^\\times$ is a cyclic group of order $hdislawq-1$, this forces $hdislawq \\equiv 1 \\pmod{zqkmytgh}$ as claimed.\n\\end{proof}"
    },
    "kernel_variant": {
      "question": "Let the integer sequence $\\,(a_n)_{n\\ge 0}$ be defined by the second–order linear recurrence  \n\\[\na_0 = 1,\\qquad a_1 = 7,\\qquad \na_{n}=14\\,a_{n-1}-a_{n-2}\\qquad(n\\ge 2).\n\\]\n\nThroughout put  \n\\[\n\\alpha = 7+4\\sqrt{3},\\qquad \n\\beta = 7-4\\sqrt{3},\\qquad \n\\alpha\\beta=1 ,\n\\]\nso that  \n\\[\na_n=\\dfrac{\\alpha^{\\,n}+\\beta^{\\,n}}{2}\\qquad(n\\ge 0).\n\\]\n\nIntroduce the companion (first–kind Lucas) sequence  \n\\[\nb_n:=\\dfrac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\\qquad(n\\ge 0).\n\\]\n\nA prime $p$ is said to be {\\em primitive for $n$} if $p\\mid a_n$ but\n$p\\nmid a_m$ for every $0<m<n$.\n\n(a)  Show that $\\,(b_n)_{n\\ge 0}$ satisfies the same recurrence  \n\\[\nb_{n}=14\\,b_{n-1}-b_{n-2}\\qquad(n\\ge 2)\n\\]\nand that $\\gcd(a_n,b_n)=1$ for every $n\\ge 1$.\n\n(b)  Let $k$ be any odd positive integer.\n\n\\;\\;(i)  Prove that $a_n\\mid a_{kn}$ and $b_n\\mid b_{kn}$ for every $n\\ge 1$.  \n\n\\;\\;(ii)  Deduce that $a_n b_n\\mid a_{kn}\\,b_{kn}$.\n\n(c)  Let $n\\ge 2$ and let $p$ be a primitive prime divisor of $a_n$.\n\n\\;\\;(i)  Working in a suitable finite field show that $\\displaystyle\\alpha^{\\,2n}\\equiv-1\\pmod{p}$.  \n\n\\;\\;(ii)  Put  \n\\[\nf=\\begin{cases}\n1,&\\text{if }3\\text{ is a square modulo }p,\\\\[4pt]\n2,&\\text{otherwise.}\n\\end{cases}\n\\]\nProve that $\\alpha\\in\\Bbb F_{p^{\\,f}}^{\\times}$ and that its multiplicative\norder equals $4n$.\n\n\\;\\;(iii)  Deduce that $4n\\mid p^{\\,f}-1$, and hence that  \n$\np^{\\,2}\\equiv 1\\pmod{4n}.\n$\n\n(d)  Specialise to $n=2023=7\\cdot17^{2}$.\n\n\\;\\;(i)  Use part (b) with $k=17^{2}$ to show that $a_7\\mid a_{2023}$ and that every prime\ndividing $a_7$ also divides $a_{2023}$.\n\n\\;\\;(ii)  Evaluate $a_7$ explicitly and factor it completely.\n\n\\;\\;(iii)  Let $p$ be the larger prime factor found in (ii).\nVerify that $p^{\\,2}\\equiv1\\pmod{28}$ (as predicted by part (c) with\n$n=7$), and record its numerical value to give an explicit, non-trivial\nprime divisor of $a_{2023}$.\n\nAn explicit numerical answer for the prime in (d)(iii) is required.",
      "solution": "Preliminaries – closed formulae  \nThe characteristic polynomial $x^{2}-14x+1$ has distinct roots\n$\\alpha,\\,\\beta$ defined above, and the Binet formulas\n\\[\na_n=\\frac{\\alpha^{\\,n}+\\beta^{\\,n}}{2},\\qquad\nb_n=\\frac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\n\\]\nshow $a_n,b_n\\in\\Bbb Z$ because $\\alpha+\\beta,\\,\\alpha\\beta\\in\\Bbb Z$.\n\n--------------------------------------------------------------------\n(a)  Recurrence and coprimality  \n\nRecurrence.  Since each root satisfies $\\gamma^{2}=14\\gamma-1$\n($\\gamma=\\alpha,\\beta$),\n\\[\n\\begin{aligned}\nb_{n}&=\\frac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\n      =\\frac{\\alpha^{\\,n-1}(14\\alpha-1)-\\beta^{\\,n-1}(14\\beta-1)}{\\alpha-\\beta}\\\\\n      &=14\\,\\frac{\\alpha^{\\,n-1}-\\beta^{\\,n-1}}{\\alpha-\\beta}\n        -\\frac{\\alpha^{\\,n-2}-\\beta^{\\,n-2}}{\\alpha-\\beta}\n      =14\\,b_{n-1}-b_{n-2},\n\\end{aligned}\n\\]\nso $(b_n)$ obeys the same recurrence.\n\nCoprimality.  \nAssume a prime $p$ divides both $a_n$ and $b_n$ for some $n\\ge 1$.\nInside the field $\\Bbb F_{p}(\\sqrt 3)$ the congruences\n$a_n\\equiv0$ and $b_n\\equiv0$ give\n$\\alpha^{\\,n}\\equiv-\\beta^{\\,n}$ and $\\alpha^{\\,n}\\equiv\\beta^{\\,n}$,\nwhence $2\\alpha^{\\,n}\\equiv 0$.  Because all $a_n$ are odd, $p\\neq 2$,\nand $\\alpha$ is invertible, a contradiction follows.  Hence\n$\\gcd(a_n,b_n)=1$.\n\n--------------------------------------------------------------------\n(b)  Odd-multiplier divisibility  \n\nChebyshev machinery.\nPut \n\\[\nx=\\frac{\\alpha^{\\,n}+\\beta^{\\,n}}{2}=a_{n}.\n\\]\nBecause $\\alpha\\beta=1$ we may write $\\alpha^{\\,n}=x+\\sqrt{x^{2}-1}$ and\n$\\beta^{\\,n}=x-\\sqrt{x^{2}-1}$; therefore  \n\\[\n\\alpha^{\\,kn}+\\beta^{\\,kn}=2T_{k}(x),\\qquad\n\\alpha^{\\,kn}-\\beta^{\\,kn}=2\\sqrt{x^{2}-1}\\,U_{k-1}(x),\n\\]\nwith $T_k,\\,U_{k-1}$ the Chebyshev polynomials of the first\nand second kind.  Consequently\n\\[\na_{kn}=T_{k}(a_{n}),\\qquad\nb_{kn}=b_{n}\\,U_{k-1}(a_{n}).\n\\]\n\nDivisibility for odd $k$.\nFor odd $k$ the polynomial $T_k$ is odd: $T_k(t)=t\\,R_k(t^{2})$\nwith $R_k\\in\\Bbb Z[t]$.  Hence\n\\[\na_{kn}=a_{n}\\,R_k(a_{n}^{2})\\quad\\Longrightarrow\\quad\na_{n}\\mid a_{kn}.\n\\]\nSimilarly $k-1$ is even, so $U_{k-1}$ is an even polynomial and\n$U_{k-1}(a_{n})\\in\\Bbb Z$, giving\n\\[\nb_{kn}=b_{n}\\,U_{k-1}(a_{n})\\quad\\Longrightarrow\\quad\nb_{n}\\mid b_{kn}.\n\\]\n\nProduct divisibility.\nBecause $\\gcd(a_{n},b_{n})=1$ (part (a)),  \n\\[\na_{n}b_{n}\\;\\bigm|\\;a_{kn}b_{kn}.\n\\]\n\n--------------------------------------------------------------------\n(c)  Primitive prime divisors  \n\nLet $p$ be primitive for $n\\ge 2$.\n\n(i)  Because $a_n\\equiv0\\pmod{p}$ we have\n$\\alpha^{\\,n}+\\beta^{\\,n}\\equiv0$.  Since $\\beta=\\alpha^{-1}$,\n$\\alpha^{\\,n}+\\alpha^{-n}\\equiv0$, so  \n\\[\n\\boxed{\\alpha^{\\,2n}\\equiv-1\\pmod{p}}.\n\\]\n\n(ii)  By the choice of $f$ we have $\\sqrt{3}\\in\\Bbb F_{p^{\\,f}}$,\nwhence $\\alpha,\\beta\\in\\Bbb F_{p^{\\,f}}^{\\times}$.  Let  \n\\[\nd:=\\operatorname{ord}_{\\Bbb F_{p^{\\,f}}^{\\times}}\\alpha .\n\\]\nBecause $\\alpha^{\\,4n}=1$, we know $d\\mid 4n$.  \nFurthermore $\\alpha^{\\,2n}=-1\\neq 1$, so $2n\\nmid d$.  Hence\n\n\\[\nd\\ \\text{divides }4n\\ \\text{but does not divide }2n .\n\\tag{$\\star$}\n\\]\n\nWrite $n=q\\,r$ where $q\\mid n$ is any proper positive divisor and\n$r>1$.  Observe that every divisor of $4n$ not dividing $2n$ is of the\nform $d=4q$ with $q\\mid n$ (indeed, such a divisor must contain the\nfactor $4$, and the remaining part must divide $n$).  \nWe now rule out {\\em all} possibilities $d=4q$ with $q<n$.\n\nAssume, for contradiction, that $d=4q$ with $q\\mid n$ and $q<n$.\nBecause $d$ is the order of $\\alpha$ we have $\\alpha^{\\,4q}=1$, hence\n$\\alpha^{\\,2q}=\\pm1$.  Since $n=q\\,r$ with $r$ odd (because any factor\n$2$ is absorbed into $4$) we compute\n\\[\n\\alpha^{\\,2n}=(\\alpha^{\\,2q})^{\\,r}= -1\\quad\\text{by part (i).}\n\\]\nThus $\\alpha^{\\,2q}=-1$, which implies\n\\[\n\\alpha^{\\,q}+\\alpha^{-q}=0\\quad\\Longrightarrow\\quad a_q=0\\pmod{p}.\n\\]\nBecause $q<n$, this contradicts the primitiveness of $p$ for $n$.\nTherefore no such $q$ exists and the only remaining option in\n$(\\star)$ is\n\\[\n\\boxed{d=4n}.\n\\]\n\n(iii)  In any finite field the multiplicative order of an element\ndivides the group order, so $d\\mid p^{\\,f}-1$.  \nHence $4n\\mid p^{\\,f}-1$, and because $f\\le 2$ we obtain\n\\[\n\\boxed{p^{\\,2}\\equiv1\\pmod{4n}}.\n\\]\n\n--------------------------------------------------------------------\n(d)  The case $n=2023=7\\cdot17^{2}$  \n\n(i)  With $k=17^{2}$ (odd) and $n=7$ part (b) gives\n$a_7\\mid a_{2023}$.  Hence every prime divisor of $a_7$ also\ndivides $a_{2023}$.\n\n(ii)  Successively applying the recurrence yields  \n\\[\n\\begin{aligned}\na_2&=97,\\\\\na_3&=1351,\\\\\na_4&=18\\,817,\\\\\na_5&=262\\,087,\\\\\na_6&=3\\,650\\,401,\\\\\na_7&=50\\,843\\,527.\n\\end{aligned}\n\\]\nA short factorisation shows  \n\\[\n50\\,843\\,527 = 7^{2}\\times 1\\,037\\,623,\n\\]\nand $1\\,037\\,623$ is prime.\n\n(iii)  Put $p=1\\,037\\,623$.  Part (c)(iii) with $n=7$ predicts\n$p^{\\,2}\\equiv1\\pmod{28}$ for every primitive prime divisor of $a_7$.\nIndeed\n\\[\n1\\,037\\,623\\equiv-1\\pmod{28}\\quad\\Longrightarrow\\quad\np^{\\,2}\\equiv(-1)^{2}=1\\pmod{28},\n\\]\nconfirming the prediction.  Because $a_7\\mid a_{2023}$ we have\n\\[\n\\boxed{p=1\\,037\\,623\\ \\text{ divides }\\ a_{2023}}.\n\\]\n\n--------------------------------------------------------------------",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.836182",
        "was_fixed": false,
        "difficulty_analysis": "1.  Higher structural level – the problem now deals with two inter-related sequences $(a_n)$ and $(b_n)$, coprimality, and primitive prime divisors, rather than a single divisibility property.\n\n2.  Field-theoretic techniques – the solution uses explicit Galois–theoretic arguments inside the quadratic field $\\mathbb Q(\\sqrt3)$ and its reductions mod $p$, not merely elementary integer manipulations.\n\n3.  Orders in multiplicative groups – part (c) forces the contestant to determine exact multiplicative orders of algebraic integers and of the integer 7 modulo a primitive prime, an appreciable step beyond the original task.\n\n4.  Simultaneous congruences – the requested prime must satisfy a non-trivial system (here “≡1 (mod 78)”), whereas the original required only “≡1 (mod 7)”.\n\n5.  Multiple interacting concepts – the argument blends Binet-type formulas, unit norms (αβ=1), recurrence divisibility, quadratic reciprocity (to show √3 ∈ 𝔽_p), and group-order reasoning.\n\nAltogether these layers of algebraic number theory, group theory and recurrence arithmetic make the enhanced variant significantly more demanding than both the original Olympiad question and the previous kernel version."
      }
    },
    "original_kernel_variant": {
      "question": "Let the integer sequence $\\,(a_n)_{n\\ge 0}$ be defined by the second–order linear recurrence  \n\\[\na_0 = 1,\\qquad a_1 = 7,\\qquad \na_{n}=14\\,a_{n-1}-a_{n-2}\\qquad(n\\ge 2).\n\\]\n\nThroughout put  \n\\[\n\\alpha = 7+4\\sqrt{3},\\qquad \n\\beta = 7-4\\sqrt{3},\\qquad \n\\alpha\\beta=1 ,\n\\]\nso that  \n\\[\na_n=\\dfrac{\\alpha^{\\,n}+\\beta^{\\,n}}{2}\\qquad(n\\ge 0).\n\\]\n\nIntroduce the companion (first–kind Lucas) sequence  \n\\[\nb_n:=\\dfrac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\\qquad(n\\ge 0).\n\\]\n\nA prime $p$ is said to be {\\em primitive for $n$} if $p\\mid a_n$ but\n$p\\nmid a_m$ for every $0<m<n$.\n\n(a)  Show that $\\,(b_n)_{n\\ge 0}$ satisfies the same recurrence  \n\\[\nb_{n}=14\\,b_{n-1}-b_{n-2}\\qquad(n\\ge 2)\n\\]\nand that $\\gcd(a_n,b_n)=1$ for every $n\\ge 1$.\n\n(b)  Let $k$ be any odd positive integer.\n\n\\;\\;(i)  Prove that $a_n\\mid a_{kn}$ and $b_n\\mid b_{kn}$ for every $n\\ge 1$.  \n\n\\;\\;(ii)  Deduce that $a_n b_n\\mid a_{kn}\\,b_{kn}$.\n\n(c)  Let $n\\ge 2$ and let $p$ be a primitive prime divisor of $a_n$.\n\n\\;\\;(i)  Working in a suitable finite field show that $\\displaystyle\\alpha^{\\,2n}\\equiv-1\\pmod{p}$.  \n\n\\;\\;(ii)  Put  \n\\[\nf=\\begin{cases}\n1,&\\text{if }3\\text{ is a square modulo }p,\\\\[4pt]\n2,&\\text{otherwise.}\n\\end{cases}\n\\]\nProve that $\\alpha\\in\\Bbb F_{p^{\\,f}}^{\\times}$ and that its multiplicative\norder equals $4n$.\n\n\\;\\;(iii)  Deduce that $4n\\mid p^{\\,f}-1$, and hence that  \n$\np^{\\,2}\\equiv 1\\pmod{4n}.\n$\n\n(d)  Specialise to $n=2023=7\\cdot17^{2}$.\n\n\\;\\;(i)  Use part (b) with $k=17^{2}$ to show that $a_7\\mid a_{2023}$ and that every prime\ndividing $a_7$ also divides $a_{2023}$.\n\n\\;\\;(ii)  Evaluate $a_7$ explicitly and factor it completely.\n\n\\;\\;(iii)  Let $p$ be the larger prime factor found in (ii).\nVerify that $p^{\\,2}\\equiv1\\pmod{28}$ (as predicted by part (c) with\n$n=7$), and record its numerical value to give an explicit, non-trivial\nprime divisor of $a_{2023}$.\n\nAn explicit numerical answer for the prime in (d)(iii) is required.",
      "solution": "Preliminaries – closed formulae  \nThe characteristic polynomial $x^{2}-14x+1$ has distinct roots\n$\\alpha,\\,\\beta$ defined above, and the Binet formulas\n\\[\na_n=\\frac{\\alpha^{\\,n}+\\beta^{\\,n}}{2},\\qquad\nb_n=\\frac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\n\\]\nshow $a_n,b_n\\in\\Bbb Z$ because $\\alpha+\\beta,\\,\\alpha\\beta\\in\\Bbb Z$.\n\n--------------------------------------------------------------------\n(a)  Recurrence and coprimality  \n\nRecurrence.  Since each root satisfies $\\gamma^{2}=14\\gamma-1$\n($\\gamma=\\alpha,\\beta$),\n\\[\n\\begin{aligned}\nb_{n}&=\\frac{\\alpha^{\\,n}-\\beta^{\\,n}}{\\alpha-\\beta}\n      =\\frac{\\alpha^{\\,n-1}(14\\alpha-1)-\\beta^{\\,n-1}(14\\beta-1)}{\\alpha-\\beta}\\\\\n      &=14\\,\\frac{\\alpha^{\\,n-1}-\\beta^{\\,n-1}}{\\alpha-\\beta}\n        -\\frac{\\alpha^{\\,n-2}-\\beta^{\\,n-2}}{\\alpha-\\beta}\n      =14\\,b_{n-1}-b_{n-2},\n\\end{aligned}\n\\]\nso $(b_n)$ obeys the same recurrence.\n\nCoprimality.  \nAssume a prime $p$ divides both $a_n$ and $b_n$ for some $n\\ge 1$.\nInside the field $\\Bbb F_{p}(\\sqrt 3)$ the congruences\n$a_n\\equiv0$ and $b_n\\equiv0$ give\n$\\alpha^{\\,n}\\equiv-\\beta^{\\,n}$ and $\\alpha^{\\,n}\\equiv\\beta^{\\,n}$,\nwhence $2\\alpha^{\\,n}\\equiv 0$.  Because all $a_n$ are odd, $p\\neq 2$,\nand $\\alpha$ is invertible, a contradiction follows.  Hence\n$\\gcd(a_n,b_n)=1$.\n\n--------------------------------------------------------------------\n(b)  Odd-multiplier divisibility  \n\nChebyshev machinery.\nPut \n\\[\nx=\\frac{\\alpha^{\\,n}+\\beta^{\\,n}}{2}=a_{n}.\n\\]\nBecause $\\alpha\\beta=1$ we may write $\\alpha^{\\,n}=x+\\sqrt{x^{2}-1}$ and\n$\\beta^{\\,n}=x-\\sqrt{x^{2}-1}$; therefore  \n\\[\n\\alpha^{\\,kn}+\\beta^{\\,kn}=2T_{k}(x),\\qquad\n\\alpha^{\\,kn}-\\beta^{\\,kn}=2\\sqrt{x^{2}-1}\\,U_{k-1}(x),\n\\]\nwith $T_k,\\,U_{k-1}$ the Chebyshev polynomials of the first\nand second kind.  Consequently\n\\[\na_{kn}=T_{k}(a_{n}),\\qquad\nb_{kn}=b_{n}\\,U_{k-1}(a_{n}).\n\\]\n\nDivisibility for odd $k$.\nFor odd $k$ the polynomial $T_k$ is odd: $T_k(t)=t\\,R_k(t^{2})$\nwith $R_k\\in\\Bbb Z[t]$.  Hence\n\\[\na_{kn}=a_{n}\\,R_k(a_{n}^{2})\\quad\\Longrightarrow\\quad\na_{n}\\mid a_{kn}.\n\\]\nSimilarly $k-1$ is even, so $U_{k-1}$ is an even polynomial and\n$U_{k-1}(a_{n})\\in\\Bbb Z$, giving\n\\[\nb_{kn}=b_{n}\\,U_{k-1}(a_{n})\\quad\\Longrightarrow\\quad\nb_{n}\\mid b_{kn}.\n\\]\n\nProduct divisibility.\nBecause $\\gcd(a_{n},b_{n})=1$ (part (a)),  \n\\[\na_{n}b_{n}\\;\\bigm|\\;a_{kn}b_{kn}.\n\\]\n\n--------------------------------------------------------------------\n(c)  Primitive prime divisors  \n\nLet $p$ be primitive for $n\\ge 2$.\n\n(i)  Because $a_n\\equiv0\\pmod{p}$ we have\n$\\alpha^{\\,n}+\\beta^{\\,n}\\equiv0$.  Since $\\beta=\\alpha^{-1}$,\n$\\alpha^{\\,n}+\\alpha^{-n}\\equiv0$, so  \n\\[\n\\boxed{\\alpha^{\\,2n}\\equiv-1\\pmod{p}}.\n\\]\n\n(ii)  By the choice of $f$ we have $\\sqrt{3}\\in\\Bbb F_{p^{\\,f}}$,\nwhence $\\alpha,\\beta\\in\\Bbb F_{p^{\\,f}}^{\\times}$.  Let  \n\\[\nd:=\\operatorname{ord}_{\\Bbb F_{p^{\\,f}}^{\\times}}\\alpha .\n\\]\nBecause $\\alpha^{\\,4n}=1$, we know $d\\mid 4n$.  \nFurthermore $\\alpha^{\\,2n}=-1\\neq 1$, so $2n\\nmid d$.  Hence\n\n\\[\nd\\ \\text{divides }4n\\ \\text{but does not divide }2n .\n\\tag{$\\star$}\n\\]\n\nWrite $n=q\\,r$ where $q\\mid n$ is any proper positive divisor and\n$r>1$.  Observe that every divisor of $4n$ not dividing $2n$ is of the\nform $d=4q$ with $q\\mid n$ (indeed, such a divisor must contain the\nfactor $4$, and the remaining part must divide $n$).  \nWe now rule out {\\em all} possibilities $d=4q$ with $q<n$.\n\nAssume, for contradiction, that $d=4q$ with $q\\mid n$ and $q<n$.\nBecause $d$ is the order of $\\alpha$ we have $\\alpha^{\\,4q}=1$, hence\n$\\alpha^{\\,2q}=\\pm1$.  Since $n=q\\,r$ with $r$ odd (because any factor\n$2$ is absorbed into $4$) we compute\n\\[\n\\alpha^{\\,2n}=(\\alpha^{\\,2q})^{\\,r}= -1\\quad\\text{by part (i).}\n\\]\nThus $\\alpha^{\\,2q}=-1$, which implies\n\\[\n\\alpha^{\\,q}+\\alpha^{-q}=0\\quad\\Longrightarrow\\quad a_q=0\\pmod{p}.\n\\]\nBecause $q<n$, this contradicts the primitiveness of $p$ for $n$.\nTherefore no such $q$ exists and the only remaining option in\n$(\\star)$ is\n\\[\n\\boxed{d=4n}.\n\\]\n\n(iii)  In any finite field the multiplicative order of an element\ndivides the group order, so $d\\mid p^{\\,f}-1$.  \nHence $4n\\mid p^{\\,f}-1$, and because $f\\le 2$ we obtain\n\\[\n\\boxed{p^{\\,2}\\equiv1\\pmod{4n}}.\n\\]\n\n--------------------------------------------------------------------\n(d)  The case $n=2023=7\\cdot17^{2}$  \n\n(i)  With $k=17^{2}$ (odd) and $n=7$ part (b) gives\n$a_7\\mid a_{2023}$.  Hence every prime divisor of $a_7$ also\ndivides $a_{2023}$.\n\n(ii)  Successively applying the recurrence yields  \n\\[\n\\begin{aligned}\na_2&=97,\\\\\na_3&=1351,\\\\\na_4&=18\\,817,\\\\\na_5&=262\\,087,\\\\\na_6&=3\\,650\\,401,\\\\\na_7&=50\\,843\\,527.\n\\end{aligned}\n\\]\nA short factorisation shows  \n\\[\n50\\,843\\,527 = 7^{2}\\times 1\\,037\\,623,\n\\]\nand $1\\,037\\,623$ is prime.\n\n(iii)  Put $p=1\\,037\\,623$.  Part (c)(iii) with $n=7$ predicts\n$p^{\\,2}\\equiv1\\pmod{28}$ for every primitive prime divisor of $a_7$.\nIndeed\n\\[\n1\\,037\\,623\\equiv-1\\pmod{28}\\quad\\Longrightarrow\\quad\np^{\\,2}\\equiv(-1)^{2}=1\\pmod{28},\n\\]\nconfirming the prediction.  Because $a_7\\mid a_{2023}$ we have\n\\[\n\\boxed{p=1\\,037\\,623\\ \\text{ divides }\\ a_{2023}}.\n\\]\n\n--------------------------------------------------------------------",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.638508",
        "was_fixed": false,
        "difficulty_analysis": "1.  Higher structural level – the problem now deals with two inter-related sequences $(a_n)$ and $(b_n)$, coprimality, and primitive prime divisors, rather than a single divisibility property.\n\n2.  Field-theoretic techniques – the solution uses explicit Galois–theoretic arguments inside the quadratic field $\\mathbb Q(\\sqrt3)$ and its reductions mod $p$, not merely elementary integer manipulations.\n\n3.  Orders in multiplicative groups – part (c) forces the contestant to determine exact multiplicative orders of algebraic integers and of the integer 7 modulo a primitive prime, an appreciable step beyond the original task.\n\n4.  Simultaneous congruences – the requested prime must satisfy a non-trivial system (here “≡1 (mod 78)”), whereas the original required only “≡1 (mod 7)”.\n\n5.  Multiple interacting concepts – the argument blends Binet-type formulas, unit norms (αβ=1), recurrence divisibility, quadratic reciprocity (to show √3 ∈ 𝔽_p), and group-order reasoning.\n\nAltogether these layers of algebraic number theory, group theory and recurrence arithmetic make the enhanced variant significantly more demanding than both the original Olympiad question and the previous kernel version."
      }
    }
  },
  "checked": true,
  "problem_type": "calculation"
}