{
  "index": "1995-B-3",
  "type": "ALG",
  "tag": [
    "ALG",
    "COMB"
  ],
  "difficulty": "",
  "question": "associate the determinant of the matrix obtained by writing the\ndigits in order across the rows. For example, for $n=2$, to the\ninteger 8617 we associate $\\det \\left(\n \\begin{array}{cc} 8 & 6 \\\\\n1 & 7 \\end{array} \\right) = 50$. Find, as a function of $n$, the\nsum of all the determinants associated with $n^{2}$-digit\nintegers. (Leading digits are assumed to be nonzero; for example,\nfor $n=2$, there are 9000 determinants.)",
  "solution": "For $n=1$ we obviously get 45, while for $n=3$ the answer is 0\nbecause it both changes sign (because determinants are alternating)\nand remains unchanged (by symmetry) when you switch any two rows other\nthan the first one. So only $n=2$ is left. By the multilinearity of\nthe determinant, the answer is the determinant of the matrix whose\nfirst (resp. second) row is the sum of all possible first (resp.\nsecond) rows. There are 90 first rows whose sum is the vector $(450,\n405)$, and 100 second rows whose sum is $(450, 450)$. Thus the answer\nis $450\\times 450 - 450 \\times 405 = 45 \\times 450 = 20250.$",
  "vars": [
    "n"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "sizevar"
      },
      "question": "associate the determinant of the matrix obtained by writing the digits in order across the rows. For example, for $sizevar=2$, to the integer 8617 we associate $\\det \\left(\\begin{array}{cc} 8 & 6 \\\\ 1 & 7 \\end{array}\\right) = 50$. Find, as a function of $sizevar$, the sum of all the determinants associated with $sizevar^{2}$-digit integers. (Leading digits are assumed to be nonzero; for example, for $sizevar=2$, there are 9000 determinants.)",
      "solution": "For $sizevar=1$ we obviously get 45, while for $sizevar=3$ the answer is 0 because it both changes sign (because determinants are alternating) and remains unchanged (by symmetry) when you switch any two rows other than the first one. So only $sizevar=2$ is left. By the multilinearity of the determinant, the answer is the determinant of the matrix whose first (resp. second) row is the sum of all possible first (resp. second) rows. There are 90 first rows whose sum is the vector $(450, 405)$, and 100 second rows whose sum is $(450, 450)$. Thus the answer is $450\\times 450 - 450 \\times 405 = 45 \\times 450 = 20250.$"
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "giraffes"
      },
      "question": "associate the determinant of the matrix obtained by writing the\ndigits in order across the rows. For example, for $giraffes=2$, to the\ninteger 8617 we associate $\\det \\left(\n \\begin{array}{cc} 8 & 6 \\\\\n1 & 7 \\end{array} \\right) = 50$. Find, as a function of $giraffes$, the\nsum of all the determinants associated with $giraffes^{2}$-digit\nintegers. (Leading digits are assumed to be nonzero; for example,\nfor $giraffes=2$, there are 9000 determinants.)",
      "solution": "For $giraffes=1$ we obviously get 45, while for $giraffes=3$ the answer is 0\nbecause it both changes sign (because determinants are alternating)\nand remains unchanged (by symmetry) when you switch any two rows other\nthan the first one. So only $giraffes=2$ is left. By the multilinearity of\nthe determinant, the answer is the determinant of the matrix whose\nfirst (resp. second) row is the sum of all possible first (resp.\nsecond) rows. There are 90 first rows whose sum is the vector $(450,\n405)$, and 100 second rows whose sum is $(450, 450)$. Thus the answer\nis $450\\times 450 - 450 \\times 405 = 45 \\times 450 = 20250.$"
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "endlessnum"
      },
      "question": "associate the determinant of the matrix obtained by writing the\ndigits in order across the rows. For example, for $endlessnum=2$, to the\ninteger 8617 we associate $\\det \\left(\n \\begin{array}{cc} 8 & 6 \\\\\n1 & 7 \\end{array} \\right) = 50$. Find, as a function of $endlessnum$, the\nsum of all the determinants associated with $endlessnum^{2}$-digit\nintegers. (Leading digits are assumed to be nonzero; for example,\nfor $endlessnum=2$, there are 9000 determinants.)",
      "solution": "For $endlessnum=1$ we obviously get 45, while for $endlessnum=3$ the answer is 0\nbecause it both changes sign (because determinants are alternating)\nand remains unchanged (by symmetry) when you switch any two rows other\nthan the first one. So only $endlessnum=2$ is left. By the multilinearity of\nthe determinant, the answer is the determinant of the matrix whose\nfirst (resp. second) row is the sum of all possible first (resp.\nsecond) rows. There are 90 first rows whose sum is the vector $(450,\n405)$, and 100 second rows whose sum is $(450, 450)$. Thus the answer\nis $450\\times 450 - 450 \\times 405 = 45 \\times 450 = 20250.$"
    },
    "garbled_string": {
      "map": {
        "n": "qzxwvtnp"
      },
      "question": "associate the determinant of the matrix obtained by writing the\ndigits in order across the rows. For example, for $qzxwvtnp=2$, to the\ninteger 8617 we associate $\\det \\left(\n \\begin{array}{cc} 8 & 6 \\\\\n1 & 7 \\end{array} \\right) = 50$. Find, as a function of $qzxwvtnp$, the\nsum of all the determinants associated with $qzxwvtnp^{2}$-digit\nintegers. (Leading digits are assumed to be nonzero; for example,\nfor $qzxwvtnp=2$, there are 9000 determinants.)",
      "solution": "For $qzxwvtnp=1$ we obviously get 45, while for $qzxwvtnp=3$ the answer is 0\nbecause it both changes sign (because determinants are alternating)\nand remains unchanged (by symmetry) when you switch any two rows other\nthan the first one. So only $qzxwvtnp=2$ is left. By the multilinearity of\nthe determinant, the answer is the determinant of the matrix whose\nfirst (resp. second) row is the sum of all possible first (resp.\nsecond) rows. There are 90 first rows whose sum is the vector $(450,\n405)$, and 100 second rows whose sum is $(450, 450)$. Thus the answer\nis $450\\times 450 - 450 \\times 405 = 45 \\times 450 = 20250.$"
    },
    "kernel_variant": {
      "question": "Fix a primitive seventh root of unity  \n\n  ζ = e^{2π i /7}.  \n\nFor every positive integer n consider all (base-7) integers that  \n\n• consist of exactly n² base-7 digits;  \n• have a non–zero leading digit.\n\nWriting the n² digits successively into rows of length n produces an n × n matrix  \n\n  A = (a_{ij})_{1≤ i,j ≤ n} with a_{ij} ∈ {0,1,…,6}.  \n\nTo the matrix A attach the “twisted determinant’’  \n\n  F(A) = ζ^{\\,\\sum_{i,j} a_{ij}^{2}} · det A.                                                      (★)\n\n(Here the exponent is the sum of the squares of the n² entries, taken in ℤ/7ℤ.)  \nFinally define  \n\n  T_n = Σ_{A admissible} F(A),\n\nthe sum being over all matrices that arise from admissible n²-digit base-7 integers.  \nDetermine T_n explicitly for every positive integer n.\n\n———————————————————————————————————————————",
      "solution": "Throughout put  \n\n G := Σ_{x=0}^{6} ζ^{x²}   (the quadratic Gauss sum modulo 7),  \n L := Σ_{x=1}^{6} x ζ^{x²}  (the weighted quadratic Gauss sum).\n\n0.  Quadratic-Gauss-sum facts.  \nLet χ be the quadratic character modulo 7.  Classical evaluations give  \n\n  G² = –7,   G = 1 + 2(ζ + ζ² + ζ⁴);   G = i√7                                                    (1)\n\n(the last identity uses the standard choice √{–7}=i√7 because 7≡3 (mod 4)).  \nPairing the terms x and 7–x yields  \n\n  L = 7(ζ + ζ² + ζ⁴).                                                                         (2)\n\n1.  The case n = 1.  \nThe single entry d may be any element of {1,…,6}.  Hence\n\n  T₁ = Σ_{d=1}^{6} d ζ^{d²} = L = 7(ζ + ζ² + ζ⁴).                                              (3)\n\n2.  The case n = 2.  \nWrite an admissible matrix as  \n\n  A = ( a  b ;  c  d ),  a∈{1,…,6}, b,c,d∈{0,…,6}.  \n\nFormula (★) gives  \n\n  F(A) = ζ^{a²+b²+c²+d²}(ad – bc).                                                             (4)\n\nSeparating the four independent summations one finds  \n\n  T₂ = (Σ_{a=1}^{6}Σ_{d=0}^{6} a d ζ^{a²+d²}) (Σ_{b=0}^{6}Σ_{c=0}^{6} ζ^{b²+c²})\n    – (Σ_{b=0}^{6}Σ_{c=0}^{6} b c ζ^{b²+c²}) (Σ_{a=1}^{6}Σ_{d=0}^{6} ζ^{a²+d²}).          (5)\n\nIntroduce the abbreviations  \n\n  P = Σ_{a=1}^{6}Σ_{d=0}^{6} a d ζ^{a²+d²},  Q = Σ_{b=0}^{6}Σ_{c=0}^{6} ζ^{b²+c²},  \n  R = Σ_{b=0}^{6}Σ_{c=0}^{6} b c ζ^{b²+c²},  S = Σ_{a=1}^{6}Σ_{d=0}^{6} ζ^{a²+d²}.        (6)\n\nBecause the two indices in each double sum are independent,\n\n  P = (Σ_{a=1}^{6} aζ^{a²})(Σ_{d=0}^{6} dζ^{d²}) = L·L = L²,  \n  Q = G²,   R = L²,   S = (G−1)·G = G(G−1).                                                (7)\n\nHence  \n\n  T₂ = P Q − R S = L² G.                                                                     (8)\n\nUse (1) and (2):  L = (7/2)(G − 1), so L² = (49/4)(G − 1)².  \nBecause G² = –7 we have  \n\n  (G − 1)² = G² − 2G + 1 = –7 − 2G + 1 = –6 − 2G.                                            (9)\n\nSubstituting into (8):\n\n  T₂ = (49/4) G (–6 − 2G) = (49/2)(7 – 3G).                                                   (10)\n\nRe-expressed through ζ only (via (1)),\n\n  T₂ = 49 (2 – 3(ζ + ζ² + ζ⁴)).                                                              (11)\n\nNumerically, using G = i√7 ≈ 2.64575131 i,\n\n  T₂ = 171.5 – 73.5 i√7 ≈ 171.5 – 194.76 i.                                                  (12)\n\n3.  Vanishing for n ≥ 3.  \nFor n ≥ 3 interchange the 2-nd and 3-rd rows.  The twist ζ^{∑a_{ij}²} is\nunchanged, whereas the determinant changes sign.  Thus the matrices can be\npartitioned into pairs {A, A′} with F(A′)=–F(A).  Fixed points of this\ninvolution have two equal rows and therefore det A = 0.  Consequently\n\n  T_n = 0  for every n ≥ 3.                                                                  (13)\n\n4.  Final answer.  For every positive integer n,\n\n  T₁ = 7(ζ + ζ² + ζ⁴),  \n  T₂ = 49 (2 − 3(ζ + ζ² + ζ⁴)) = (49/2)(7 − 3G) = 171.5 − 73.5 i√7,  \n  T_n = 0  (n ≥ 3),\n\nwhere G = 1 + 2(ζ + ζ² + ζ⁴) = i√7.\n\n———————————————————————————————————————————",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.744264",
        "was_fixed": false,
        "difficulty_analysis": "•  Additional structure: the problem now involves a non-trivial character twist (ζ^{Σa_{ij}}), forcing the solver to work simultaneously with determinants and complex roots of unity.  \n•  Higher theoretical demands: evaluating sums such as Σ k ζ^{k} requires either differentiation of geometric series or discrete Fourier techniques.  \n•  Multiple interacting ideas: multilinearity of the determinant, involutive sign-changing symmetries, and vanishing of character sums are all essential.  \n•  The original problem collapses to a short parity argument for n ≥ 3 and a single calculation for n = 2; here even n = 2 demands a non-trivial factorisation and use of (2), while n = 1 needs analytic manipulation of root-of-unity sums.  \n•  The final answers (a complex number for n = 1 and zero thereafter) are inaccessible by simple counting or pattern spotting; a deeper blend of algebra, combinatorics and complex analysis is required."
      }
    },
    "original_kernel_variant": {
      "question": "Fix a primitive seventh root of unity  \n\n  ζ = e^{2π i /7}.  \n\nFor every positive integer n consider all (base-7) integers that  \n\n• consist of exactly n² base-7 digits;  \n• have a non–zero leading digit.\n\nWriting the n² digits successively into rows of length n produces an n × n matrix  \n\n  A = (a_{ij})_{1≤ i,j ≤ n} with a_{ij} ∈ {0,1,…,6}.  \n\nTo the matrix A attach the “twisted determinant’’  \n\n  F(A) = ζ^{\\,\\sum_{i,j} a_{ij}^{2}} · det A.                                                      (★)\n\n(Here the exponent is the sum of the squares of the n² entries, taken in ℤ/7ℤ.)  \nFinally define  \n\n  T_n = Σ_{A admissible} F(A),\n\nthe sum being over all matrices that arise from admissible n²-digit base-7 integers.  \nDetermine T_n explicitly for every positive integer n.\n\n———————————————————————————————————————————",
      "solution": "Throughout put  \n\n G := Σ_{x=0}^{6} ζ^{x²}   (the quadratic Gauss sum modulo 7),  \n L := Σ_{x=1}^{6} x ζ^{x²}  (the weighted quadratic Gauss sum).\n\n0.  Quadratic-Gauss-sum facts.  \nLet χ be the quadratic character modulo 7.  Classical evaluations give  \n\n  G² = –7,   G = 1 + 2(ζ + ζ² + ζ⁴);   G = i√7                                                    (1)\n\n(the last identity uses the standard choice √{–7}=i√7 because 7≡3 (mod 4)).  \nPairing the terms x and 7–x yields  \n\n  L = 7(ζ + ζ² + ζ⁴).                                                                         (2)\n\n1.  The case n = 1.  \nThe single entry d may be any element of {1,…,6}.  Hence\n\n  T₁ = Σ_{d=1}^{6} d ζ^{d²} = L = 7(ζ + ζ² + ζ⁴).                                              (3)\n\n2.  The case n = 2.  \nWrite an admissible matrix as  \n\n  A = ( a  b ;  c  d ),  a∈{1,…,6}, b,c,d∈{0,…,6}.  \n\nFormula (★) gives  \n\n  F(A) = ζ^{a²+b²+c²+d²}(ad – bc).                                                             (4)\n\nSeparating the four independent summations one finds  \n\n  T₂ = (Σ_{a=1}^{6}Σ_{d=0}^{6} a d ζ^{a²+d²}) (Σ_{b=0}^{6}Σ_{c=0}^{6} ζ^{b²+c²})\n    – (Σ_{b=0}^{6}Σ_{c=0}^{6} b c ζ^{b²+c²}) (Σ_{a=1}^{6}Σ_{d=0}^{6} ζ^{a²+d²}).          (5)\n\nIntroduce the abbreviations  \n\n  P = Σ_{a=1}^{6}Σ_{d=0}^{6} a d ζ^{a²+d²},  Q = Σ_{b=0}^{6}Σ_{c=0}^{6} ζ^{b²+c²},  \n  R = Σ_{b=0}^{6}Σ_{c=0}^{6} b c ζ^{b²+c²},  S = Σ_{a=1}^{6}Σ_{d=0}^{6} ζ^{a²+d²}.        (6)\n\nBecause the two indices in each double sum are independent,\n\n  P = (Σ_{a=1}^{6} aζ^{a²})(Σ_{d=0}^{6} dζ^{d²}) = L·L = L²,  \n  Q = G²,   R = L²,   S = (G−1)·G = G(G−1).                                                (7)\n\nHence  \n\n  T₂ = P Q − R S = L² G.                                                                     (8)\n\nUse (1) and (2):  L = (7/2)(G − 1), so L² = (49/4)(G − 1)².  \nBecause G² = –7 we have  \n\n  (G − 1)² = G² − 2G + 1 = –7 − 2G + 1 = –6 − 2G.                                            (9)\n\nSubstituting into (8):\n\n  T₂ = (49/4) G (–6 − 2G) = (49/2)(7 – 3G).                                                   (10)\n\nRe-expressed through ζ only (via (1)),\n\n  T₂ = 49 (2 – 3(ζ + ζ² + ζ⁴)).                                                              (11)\n\nNumerically, using G = i√7 ≈ 2.64575131 i,\n\n  T₂ = 171.5 – 73.5 i√7 ≈ 171.5 – 194.76 i.                                                  (12)\n\n3.  Vanishing for n ≥ 3.  \nFor n ≥ 3 interchange the 2-nd and 3-rd rows.  The twist ζ^{∑a_{ij}²} is\nunchanged, whereas the determinant changes sign.  Thus the matrices can be\npartitioned into pairs {A, A′} with F(A′)=–F(A).  Fixed points of this\ninvolution have two equal rows and therefore det A = 0.  Consequently\n\n  T_n = 0  for every n ≥ 3.                                                                  (13)\n\n4.  Final answer.  For every positive integer n,\n\n  T₁ = 7(ζ + ζ² + ζ⁴),  \n  T₂ = 49 (2 − 3(ζ + ζ² + ζ⁴)) = (49/2)(7 − 3G) = 171.5 − 73.5 i√7,  \n  T_n = 0  (n ≥ 3),\n\nwhere G = 1 + 2(ζ + ζ² + ζ⁴) = i√7.\n\n———————————————————————————————————————————",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.574950",
        "was_fixed": false,
        "difficulty_analysis": "•  Additional structure: the problem now involves a non-trivial character twist (ζ^{Σa_{ij}}), forcing the solver to work simultaneously with determinants and complex roots of unity.  \n•  Higher theoretical demands: evaluating sums such as Σ k ζ^{k} requires either differentiation of geometric series or discrete Fourier techniques.  \n•  Multiple interacting ideas: multilinearity of the determinant, involutive sign-changing symmetries, and vanishing of character sums are all essential.  \n•  The original problem collapses to a short parity argument for n ≥ 3 and a single calculation for n = 2; here even n = 2 demands a non-trivial factorisation and use of (2), while n = 1 needs analytic manipulation of root-of-unity sums.  \n•  The final answers (a complex number for n = 1 and zero thereafter) are inaccessible by simple counting or pattern spotting; a deeper blend of algebra, combinatorics and complex analysis is required."
      }
    }
  },
  "checked": true,
  "problem_type": "calculation"
}