5

In general determinants are not additive (related question). Nevertheless, matrices $A$ and $B$ can be chosen so that $\det A+\det B=\det\left(A+B\right)$ (related answer).

For which positive integer $n$ can $2 n^{2}$ consecutive prime numbers form a solution of the equation $$ \det A + \det B = \det\left(A + B\right) $$ with two $n\times n$ matrices $A$, $B$?

$n=2$

A solution for $n=2$:

  • $A=\begin{pmatrix}17 & 19\\23 & 29\end{pmatrix}$, $B=\begin{pmatrix}31 & 37\\41 & 43\end{pmatrix}$, $\det A=56$, $\det B=-184$, $\det\left(A+B\right)=-128$

There are many solutions for $n=2$ but I don't know if there are infinitely many. Even with the added restriction that the 8 primes must appear in increasing order, I found 110 solutions with entries below ${10}^7$, the first few are:

A = [[17, 19], [23, 29]], B = [[31, 37], [41, 43]], det A = 56, det B = -184, det (A+B) = -128
A = [[149, 151], [157, 163]], B = [[167, 173], [179, 181]], det A = 580, det B = -740, det (A+B) = -160
A = [[521, 523], [541, 547]], B = [[557, 563], [569, 571]], det A = 2044, det B = -2300, det (A+B) = -256
A = [[1277, 1279], [1283, 1289]], B = [[1291, 1297], [1301, 1303]], det A = 5096, det B = -5224, det (A+B) = -128
A = [[5437, 5441], [5443, 5449]], B = [[5471, 5477], [5479, 5483]], det A = 10850, det B = -10990, det (A+B) = -140
A = [[19853, 19861], [19867, 19889]], B = [[19891, 19913], [19919, 19927]], det A = 277830, det B = -279090, det (A+B) = -1260
A = [[103963, 103967], [103969, 103979]], B = [[103981, 103991], [103993, 103997]], det A = 623754, det B = -624006, det (A+B) = -252
A = [[113147, 113149], [113153, 113159]], B = [[113161, 113167], [113171, 113173]], det A = 452576, det B = -452704, det (A+B) = -128

Are there infinitely many solutions $A=\begin{pmatrix}a & b\\c & d\end{pmatrix}$, $B=\begin{pmatrix}e & f\\g & h\end{pmatrix}$ where $a<b<c<d<e<f<g<h$ are consecutive primes?

$n=3$

Solutions for $n=3$:

  • $A=\begin{pmatrix}3 & 5 & 7\\29 & 37 & 41\\43 & 59 & 67\end{pmatrix}$, $B=\begin{pmatrix}11 & 13 & 17\\19 & 23 & 31\\47 & 53 & 61\end{pmatrix}$, $\det A=120$, $\det B=-24$, $\det\left(A+B\right)=96$
  • $A=\begin{pmatrix}2 & 3 & 5\\19 & 23 & 31\\41 & 53 & 61\end{pmatrix}$, $B=\begin{pmatrix}7 & 11 & 13\\17 & 29 & 37\\43 & 47 & 59\end{pmatrix}$, $\det A=176$, $\det B=448$, $\det\left(A+B\right)=624$

There is at least one solution formed from 18 consecutive primes with entries in increasing order first in $A$ and then in $B$:

$$A=\begin{pmatrix}726371 & 726377 & 726379\\726391 & 726413 & 726419\\726431 & 726457 & 726463\end{pmatrix},\quad B=\begin{pmatrix}726469 & 726487 & 726497\\726521 & 726527 & 726533\\726559 & 726589 & 726599\end{pmatrix}$$

$n=4$

A solution for $n=4$:

  • $A=\begin{pmatrix}2 & 3 & 5 & 7\\11 & 13 & 17 & 19\\23 & 29 & 31 & 71\\79 & 89 & 107 & 127\end{pmatrix}$, $B=\begin{pmatrix}37 & 41 & 43 & 47\\53 & 59 & 61 & 67\\73 & 83 & 97 & 101\\103 & 109 & 113 & 131\end{pmatrix}$, $\det A=744$, $\det B=936$, $\det\left(A+B\right)=1680$

$n>4$

Are there solutions for all $n$? Are there solutions for all $n$ such that entries of each matrix are increasing row-by-row (as in the above examples)? What can be known about solutions?

mezzoctane
  • 2,241
  • 2
  • 8
  • 21
  • We have a question combining the ordered list of prime numbers, picking sequences of $2n^2$ consecutive elements in the list, arranging them in the entries of two matrices in a suitable random manner, so that a coincidence appear when computing determinants. It would be a reasonable question to ask for solution of the curiosity coincidence equality $\det A+\det B=\det (A+B)$ for some special value of $n$, for instance for $n=5$, but the question comes in full generality, for all $n$ we must be able to decide if we can arrange for it. Which is the motivation for the question? – dan_fulea Oct 10 '25 at 11:45
  • 1
    @dan_fulea Curiosity is the main motivation for this question, but for all I know there may be a way to decide it for all $n$. I do not know whether it is merely a coincidence. – mezzoctane Oct 10 '25 at 13:08
  • 1
    The solution for $n=2$ has an additional property: it can be formed from 8 consecutive primes beginning at 17, putting the first four primes in order in the matrix $A$ and the last four primes in order in the matrix $B$. It turns out an analogous solution for $n=3$ can be formed from 18 consecutive primes beginning at 726371: $\det A+\det B=\det\left(A+B\right)$ holds for $$A=\begin{pmatrix}726371 & 726377 & 726379\726391 & 726413 & 726419\726431 & 726457 & 726463\end{pmatrix},\quad B=\begin{pmatrix}726469 & 726487 & 726497\726521 & 726527 & 726533\726559 & 726589 & 726599\end{pmatrix}$$ – mezzoctane Oct 10 '25 at 14:50
  • To decide it for each / all $n$ is out of reach, it would mean a lot of work, which in my opinion does not reward the effort (time, investigation, numerical searches, ...) just for the sake of a curiosity. It would at any rate be an interesting question when it would be connected to some structural properties, some random prime number statistics, some hint of an insight in solving the problem for a specific class of numbers $n$. But as it is stated, just for curiosity, there is no point. It would be a dead end question, even if somebody shows that for $n=7$ we have no luck. – dan_fulea Oct 10 '25 at 16:19
  • Also, when asking a question one should show the own effort to solve the question, the problem. Having some examples in small numbers contributes with nothing, no insight, no scheme, no starting point when something should be shown for all $n$. Also the fact that the examples in small numbers come with random permutations of the used list of consecutive primes makes the problem more than a curiosity. By the way, there is a "law of small numbers" (which is no mathematical law) saying that things may happen in "small numbers" with "small numbers", but this just happens. We need insight beyond... – dan_fulea Oct 10 '25 at 16:23
  • 1
    I have a heuristic argument for why we should expect an infinite number of solutions, but I see no hope of a proof. Would that heuristic argument be a good enough answer for you? – btilly Oct 10 '25 at 17:09
  • Yes, please post an answer. This looks like an interesting problem but I'm not sure what would be interesting questions about it... – mezzoctane Oct 10 '25 at 17:12
  • Different related question: https://math.stackexchange.com/questions/2355787/determinant-of-a-matrix-that-contains-the-first-n2-primes – mezzoctane Nov 05 '25 at 19:52

3 Answers3

3

Assuming standard number theory conjectures, there are infinitely many solutions for the $n=2$ case. More specifically, the prime $k$-tuples conjecture implies that there are infinitely many integers $p$ such that $$ \{p,p+2,p+6,p+12,p+14,p+20,p+24,p+26\} $$ comprise eight consecutive primes; and one can check that $$ \det\begin{pmatrix} p & p+2 \\ p+6 & p+12 \end{pmatrix} + \det\begin{pmatrix} p+14 & p+20 \\ p+24 & p+26 \end{pmatrix} = \det\begin{pmatrix} p+p+14 &p+2+ p+20 \\ p+6+p+24 & p+12+p+26 \end{pmatrix} $$ is an identity (for any real number $p$).

Greg Martin
  • 94,676
  • The sequence of values of $p$ is in OEIS: A022012 "Initial members of prime octuplets (p, p+2, p+6, p+12, p+14, p+20, p+24, p+26)" 17, 1277, 113147, 2580647, ... – mezzoctane Oct 10 '25 at 18:47
1

Here is a heuristic argument for there being infinitely many solutions for every $n$. (There is no hope of turning this into a proof.)

Fix $n$. Now for large $k$, let's try to estimate how many solutions there are with $p$ from $2^k - 2^{k-1}$ to $2_k + 2^{k+1}$

By the prime number theorem, there are $O(\frac{2^k}{k})$ primes in that interval. With odds bounded away from zero, the distance from $p_i$ to $p_{i+2n-1}$ is within $2nk = O(k)$. (Remember, $n$ is fixed and so is a constant.) Now $\det(A) + \det(B) - \det(A+B)$ is a a multinomial in the entries of degree $n$, with a complicated set of terms that is still $O(1)$ for fixed $n$. The terms from the first two determinants are all of the form $p_i + O(k)$, with $p_i$ being $O(2^k)$ The terms from the second two determinants are of the form $2p_i + O(k)$.

When we write out this polynomial, all terms are of the form $q_m(p_{i+1}-p_i, p_{i+2}-p_i, \ldots, p_{i+2n-1} - p_i)p_i^{n-m}$ or $r_m(p_{i+1}-p_i, p_{i+2}-p_i, \ldots, p_{i+2n-1} - p_i)2^{n-m}p_i^{n-m}$where $q_m$ and $r_m$ are multinomials of degree $m$. Also since a determinant has equal numbers of positive and negative terms, we know that $q_0 = r_0 = 0$.

Now $q_1$ has $O(k)$ possible values. $q_2$ has $O(k^2)$ possible values. And so on up to $q_{n}$ having $O(k^n)$ possible values. The same is true for $r_1$, $r_2$, and so on. (The constants are affected by the fact that there are $n!$ terms in a determinant. But that's just a biggish constant here.) Assuming that all of those polynomials are random within their range, the odds of all being zero simultaneously is $O(\frac{1}{k^{n^2 + 1})$.

But we have $O(\frac{2^k}{k})$ values of $p_i$ to consider. And therefore the number of solutions grows like $O(\frac{2^k}{\text{poly}(k)})$, which grows exponentially with $k$.

And therefore the sum of the count of solutions over all large $k$ must be infinite.

btilly
  • 3,671
  • 1
    Why the argument says "the determinant of the first $n$ minus the determinant of the second $n$" if we need $\det A+\det B=\det\left(A+B\right)$? (For $n=3$ either of $\det A\pm\det B$ expands into a polynomial with $12=2\cdot 3!$ terms, each term a product of three prime entries.) – mezzoctane Oct 10 '25 at 19:19
  • @mezzoctane Oops. Thanks for catching this! I somehow switched to $\det(A) - \det(B)$. I wanted $\det{A} + \det{B} - \det{A + B}$. Slightly more complicated, but morally the same. I fixed it. – btilly Oct 10 '25 at 19:31
0

For which positive integer $n$ can $2 n^{2}$ consecutive prime numbers form a solution of the equation $$ \det A + \det B = \det\left(A + B\right) $$ with two $n\times n$ matrices $A$, $B$?

There are solutions with $n=5$, examples below. I think for each prime $p=2,3,\ldots,41$ there is at least one solution using 50 consecutive primes beginning at $p$.

  • $A=\begin{pmatrix}2 & 3 & 5 & 7 & 11\\ 13 & 17 & 19 & 23 & 29\\ 31 & 37 & 41 & 43 & 47\\ 53 & 59 & 61 & 67 & 73\\ 139 & 163 & 179 & 199 & 223 \end{pmatrix}$, $B=\begin{pmatrix}71 & 79 & 83 & 89 & 97\\ 101 & 103 & 107 & 109 & 113\\ 127 & 131 & 137 & 149 & 151\\ 157 & 167 & 173 & 181 & 191\\ 193 & 197 & 211 & 227 & 229 \end{pmatrix}$, $\det A=5824$, $\det B=46080$, $\det\left(A+B\right)=51904$
  • $A=\begin{pmatrix}3 & 5 & 7 & 11 & 13\\ 17 & 19 & 23 & 29 & 31\\ 37 & 41 & 43 & 47 & 53\\ 59 & 61 & 67 & 71 & 73\\ 103 & 179 & 193 & 223 & 227 \end{pmatrix}$, $B=\begin{pmatrix}79 & 83 & 89 & 97 & 101\\ 107 & 109 & 113 & 127 & 131\\ 137 & 139 & 149 & 151 & 157\\ 163 & 167 & 173 & 181 & 191\\ 197 & 199 & 211 & 229 & 233 \end{pmatrix}$, $\det A=35808$, $\det B=-38112$, $\det\left(A+B\right)=-2304$
  • $A = \begin{pmatrix}5 & 7 & 11 & 13 & 17\\19 & 23 & 29 & 31 & 37\\41 & 43 & 47 & 53 & 59\\61 & 67 & 71 & 73 & 109\\139 & 157 & 181 & 199 & 233\end{pmatrix}$, $B = \begin{pmatrix}79 & 83 & 89 & 97 & 101\\103 & 107 & 113 & 127 & 131\\137 & 149 & 151 & 163 & 167\\173 & 179 & 191 & 193 & 197\\211 & 223 & 227 & 229 & 239\end{pmatrix}$, $\det A = 30976$, $\det B = -307200$, $\det\left(A+B\right) = -276224$
  • $A = \begin{pmatrix}7 & 11 & 13 & 17 & 19\\23 & 29 & 31 & 37 & 41\\43 & 47 & 53 & 59 & 61\\67 & 71 & 73 & 79 & 83\\109 & 151 & 181 & 211 & 229\end{pmatrix}$, $B = \begin{pmatrix}89 & 97 & 101 & 103 & 107\\113 & 127 & 131 & 137 & 139\\149 & 157 & 163 & 167 & 173\\179 & 191 & 193 & 197 & 199\\223 & 227 & 233 & 239 & 241\end{pmatrix}$, $\det A = 4384$, $\det B = -47200$, $\det\left(A+B\right) = -42816$

There is a solution with $6\times 6$ matrices:

$A=\begin{pmatrix}2 & 3 & 5 & 7 & 11 & 13\\ 17 & 19 & 23 & 29 & 31 & 37\\ 41 & 43 & 47 & 53 & 59 & 61\\ 67 & 71 & 73 & 79 & 83 & 89\\ 97 & 101 & 103 & 107 & 109 & 113\\ 127 & 131 & 191 & 193 & 269 & 277 \end{pmatrix}$, $B=\begin{pmatrix}137 & 139 & 149 & 151 & 157 & 163\\ 167 & 173 & 179 & 181 & 197 & 199\\ 211 & 223 & 227 & 229 & 233 & 239\\ 241 & 251 & 257 & 263 & 271 & 281\\ 283 & 293 & 307 & 311 & 313 & 317\\ 331 & 337 & 347 & 349 & 353 & 359 \end{pmatrix}$, $\det A=-91200$, $\det B=-6804480$, $\det\left(A+B\right)=-6895680$

mezzoctane
  • 2,241
  • 2
  • 8
  • 21
  • $n=7$ unsolved yet, but there is an example with $\left|\left(\det A+\det B\right)-\det\left(A+B\right)\right|=64$: fill A with 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 197, 227, 239, 383, 409, 431 and B with 193, 199, 211, 223, 229, 233, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 389, 397, 401, 419, 421, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521. – mezzoctane Nov 18 '25 at 13:08