When are numbers of the form $m^2+9k^2\pm k$ perfect squares?

186 Views Asked by At

In pursuing a question of personal interest, I need to characterize solutions to the equation $m^2+9k^2\pm k=c^2$; in other words, I want to know when numbers of the form $m^2+9k^2\pm k$ are perfect squares. In the context of my problem, $c,k,m \in \mathbb N; 2<k<m^2$. By hand, I can grind out a few examples, such as $(m,k,c)=(4,3,10),(6,5,16),(6,7,22)$, and further convince myself that some values of $m$ (such as $1,2,3,5$) yield no solutions. But I want to understand as much as possible the nature of solutions, particularly with respect to suitable values of $m$. Apparently, not all values of $m$ yield solutions. I am not a programmer, so I have been limited to using a calculator.

I have tried simple restatements of the equation to see if I can perceive any avenues of attack, e.g.: $m^2+k(9k\pm 1)=c^2$ and $k(9k\pm 1)=(c+m)(c-m)$, but I am not having any insights.

My first question is: In the context of my equation, are there any general constraints on $m$? (Such as, but not limited to, constraints on its class with respect to cerain moduli. I can't see any such thing, but maybe somebody else can.)

My second question is: Is there any number, $m_0$, such that for $m>m_0$, the equation will always have at least one $(m,k,c)$ solution? Even if no particular $m_0$ can be identified, is it possible to decide if such a number exists?

I am most grateful for the thoughts of the community.

4

There are 4 best solutions below

2
On

Above equation shown below has parametric solution:

$m^2+9k^2+k=c^2$

$m=[(5k+1)/4]$

$c=[(13k+1)/4]$

For, $k=(7)$ we get, $(m,c)=(9,23)$

For, $k=(11)$ we get, $(m,c)=(14,36)$

For, $k=(23)$ we get, $(m,c)=(29,75)$

2
On

We can find several families of solutions with the following trick. Warning: Not even attempting a complete set of solutions, yet. This was inspired by the family Sam described. A curious fact in it is that $c=m+2k$. The point of this answer is that we can find a similar infinite family of solutions with the coefficient $n=2$ replaced by any integer $n\equiv2,4\pmod6$.

Let us fix a natural number $n$. Consider the possibility that $c=m+n k$. Plugging that in gives: $$ m^2+9k^2\pm k=m^2+2mnk+n^2k^2.\qquad(*) $$ The point is that this is a linear equation in $m$ as the squared terms cancel. Furthermore, all the other terms have $k$ as a factor, so the solution to $(*)$ is simply $$ m=\frac{(9-n^2)k-1}{2n}. $$

This recipe may lead to negative values of $m$ or $c$, but their signs can freely adjusted. We also see that we cannot use $n=3$. We need to ascertain that we get integers as solutions. Anyway

  • With $n=4$ we get the family $m=(7k+1)/8$, $c=(25k-1)/8$. Here both $m$ and $c$ are integers whenever $k\equiv1\pmod8$.
  • With $n=5$ the above formula would give $m=(16k+1)/10$. This is never an integer because the numerator is always odd.
  • With $n=6$ we arrive at $m=(27k+1)/12$. This is never an integer as the numerator is never divisible by three.

Analyzing this problem a bit more we see that we need $9-n^2$ and $2n$ to be coprime to get integer solutions. That happens when $n$ is even, and $3\nmid n$. For example:

  • With $n=8$ we get $m=(55k+1)/16$, $c=(73k-1)/16$ and these are integers, when $k\equiv9\pmod{16}$.

Extending this list of families is easy. There are obvious variants gotten by using the minus sign instead.

2
On

12:06 pm, should now be little trouble to have the stuff below output a big list of solutions in shape $(6z, 6x, 1 \pm 18y)$ starting from, say, $(0,0,1).$

I write the equation as $$ (6z)^2 - (6x)^2 - (1 \pm 18y)^2 = -1. $$ The quadratic form $u^2 - v^2 - w^2 $ has an automorphism (rotation, orthogonal,...) group parametrized by versions of the modular group; I chhose integers $a,b,c,d$ with $ad-bc = \pm 1$ and $a+b+c+d \equiv 0 \pmod 2.$ These parametrize a set of matrices, call one $A,$ such that $A^T H A = H,$ where $H$ is the diagonal matrix with elements $1,-1,-1$

The matrix $A$ is $$ A = \left( \begin{array}{crc} \frac{1}{2}\left(a^2 + b^2 + c^2 + d^2 \right) & ab+cd & \frac{1}{2}\left(a^2 - b^2 + c^2 - d^2 \right) \\ ac+bd & ad+bc & ac - bd \\ \frac{1}{2}\left(a^2 + b^2 - c^2 - d^2 \right) & ab-cd & \frac{1}{2}\left(a^2 - b^2 - c^2 + d^2 \right) \\ \end{array} \right) $$ For our purposes, some congruence conditions are needed, namely $A_{13}$ and $A_{23}$ must be divisible by $6, $ then $A_{31 }, A_{32}$ divisible by $3.$ Given those four entries divisible by $3,$ we must now have $A_{33} \neq 0 \pmod 3,$ as we require $\det A \neq 0 \pmod 3.$ As a result, the matrix

$$ \left( \begin{array}{rr} a & b \\ c & d \\ \end{array} \right) $$ must be either $$ \left( \begin{array}{rr} \pm 1 & 0 \\ 0 & \pm 1 \\ \end{array} \right) \mbox{ OR } \left( \begin{array}{rr} 0& \pm 1 \\ \pm 1 &0 \\ \end{array} \right) \; \; \; \pmod 3 $$ and $$ \left( \begin{array}{rr} 1 & 0 \\ 0 & 1 \\ \end{array} \right) \mbox{ OR } \left( \begin{array}{rr} 0& 1 \\ 1 &0 \\ \end{array} \right) \; \; \; \pmod 2 $$

Writing column vector

$$ V = \left( \begin{array}{c} 6z \\ 6x \\ 1 \pm 18 y \end{array} \right) $$ we take $AV$ to be a new solution vector. It is a theorem of C. L. Siegel that there are a finite set of solutions $V_0$ from which every solution can be found. For example, this is on page 128 of Jones "the number of essentially distinct solutions of $X^T AX = B$ we show to be finite."

In what folloows, we simply take $$ V_0 = \left( \begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right) $$ which tells us that $AV_0$ is simply the right hand column of $A.$

From the other answer

Short version: integers $ad - bc = \pm 1.$ $$ m = \frac{ac-bd}{6}$$ $$ k = \frac{ \left| \frac{a^2 - b^2 - c^2 + d^2}{2} \right| \pm 1}{18} $$ $$ z= \frac{a^2 - b^2 + c^2 - d^2}{12} $$

The list is quite redundant, here are some matrices with all positive elements and $a,b,c,d$ positiv e.

Fri 24 Nov 2023 11:13:06 AM PST
-----------------------------------------------------------------------------
   11   12   13   21   22   23   31   32   33              a    b    c    d
----------------------------------------------------------------------------
   19   18    6   18   17    6    6    6    1              4    3    3    2
   73   72   12   72   71   12   12   12    1              7    6    6    5
  145  132   60   60   55   24  132  120   55             14    9    3    2
  163  162   18  162  161   18   18   18    1             10    9    9    8
  289  216  192  216  161  144  192  144  127             20    9    9    4
  289  288   24  288  287   24   24   24    1             13   12   12   11
  361  336  132   96   89   36  348  324  127             22   15    3    2
  361  348   96  132  127   36  336  324   89             21   16    4    3
  451  342  294  378  287  246  246  186  161             24   11   13    6
  451  378  246  342  287  186  294  246  161             24   13   11    6
  451  450   30  450  449   30   30   30    1             16   15   15   14
  577  552  168  168  161   48  552  528  161             27   20    4    3
  649  540  360  540  449  300  360  300  199             28   15   15    8
  649  612  216  612  577  204  216  204   71             24   17   17   12
  649  648   36  648  647   36   36   36    1             19   18   18   17
  721  684  228  684  649  216  228  216   73             25   18   18   13
  739  546  498  366  271  246  642  474  433             34   15    9    4
  739  642  366  498  433  246  546  474  271             31   18   12    7
  739  678  294  138  127   54  726  666  289             32   21    3    2
  739  726  138  294  289   54  678  666  127             29   24    6    5
  883  798  378  798  721  342  378  342  161             30   19   19   12
  883  882   42  882  881   42   42   42    1             22   21   21   20
 1153 1152   48 1152 1151   48   48   48    1             25   24   24   23
 1171 1002  606  822  703  426  834  714  431             39   22   16    9
 1171 1086  438  174  161   66 1158 1074  433             40   27    3    2
 1171 1158  174  438  433   66 1086 1074  161             36   31    7    6
 1171  834  822  606  431  426 1002  714  703             43   18   12    5
 1225 1032  660  600  505  324 1068  900  575             42   23   11    6
 1225 1068  600  660  575  324 1032  900  505             41   24   12    7
 1459 1134  918 1134  881  714  918  714  577             44   21   21   10
 1459 1458   54 1458 1457   54   54   54    1             28   27   27   26
 1603 1542  438  282  271   78 1578 1518  431             45   34    4    3
 1603 1578  282  438  431   78 1542 1518  271             43   36    6    5
 1801 1404 1128 1476 1151  924 1032  804  647             48   23   25   12
 1801 1476 1032 1404 1151  804 1128  924  647             48   25   23   12
 1801 1560  900 1560 1351  780  900  780  449             45   26   26   15
 1801 1656  708  216  199   84 1788 1644  703             50   33    3    2
 1801 1788  216  708  703   84 1656 1644  199             44   39    9    8
 1801 1800   60 1800 1799   60   60   60    1             31   30   30   29
 1873 1668  852 1212 1079  552 1428 1272  649             49   30   18   11
 2035 1950  582  318  305   90 2010 1926  575             51   38    4    3
 2035 2010  318  582  575   90 1950 1926  305             48   41    7    6
 2179 2178   66 2178 2177   66   66   66    1             34   33   33   32
 2449 2436  252  924  919   96 2268 2256  233             51   46   10    9
 2467 2238 1038 2382 2161 1002  642  582  271             47   30   36   23
 2467 2382  642 2238 2161  582 1038 1002  271             47   36   30   23
 2593 2592   72 2592 2591   72   72   72    1             37   36   36   35
 2611 2466  858 2574 2431  846  438  414  143             45   32   38   27
 2611 2574  438 2466 2431  414  858  846  143             45   38   32   27
 2755 2610  882 2718 2575  870  450  426  145             46   33   39   28
 2755 2718  450 2610 2575  426  882  870  145             46   39   33   28
 3043 3042   78 3042 3041   78   78   78    1             40   39   39   38
 3529 3528   84 3528 3527   84   84   84    1             43   42   42   41
 4051 4050   90 4050 4049   90   90   90    1             46   45   45   44
 4609 4608   96 4608 4607   96   96   96    1             49   48   48   47
-----------------------------------------------------------------------------
   11   12   13   21   22   23   31   32   33              a    b    c    d
----------------------------------------------------------------------------

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

I told it not to print $(m, m^2, 3 m^2)$ for $m > 1.$

-------------------------------------------------
    m    k    z              a    b    c    d  
-------------------------------------------------
    1    1    3              6    1    1    0
    4    3   10             14    9    3    2
    6    5   16             21   16    4    3
    6    7   22             22   15    3    2
    8    9   28             27   20    4    3
    9   16   49             32   21    3    2
    9    7   23             29   24    6    5
   11   24   73             40   27    3    2
   11    9   29             36   31    7    6
   13   15   47             43   36    6    5
   13   24   73             45   34    4    3
   14   11   36             44   39    9    8
   14   39  118             50   33    3    2
   15   17   53             48   41    7    6
   15   32   97             51   38    4    3
   16   13   42             51   46   10    9
   20    3   22             14    3    9    2
   24    7   32             20    9    9    4
   24    9   36             21    8    8    3
   31   16   57             27   10    8    3
   31    9   41             24   13   11    6
   34   32  102             35    6    6    1
   34    4   36             24   17   17   12
   36   36  114             37    6    6    1
   36    4   38             25   18   18   13
   41   15   61             31   18   12    7
   41   16   63             27    8   10    3
   41   24   83             34   15    9    4
   41    9   49             24   11   13    6
   48   16   68             29   12   12    5
   50   11   60             28   15   15    8
   50   25   90             33   10   10    3
   54   28  100             41   24   12    7
   54   32  110             42   23   11    6
   54    5   56             21    4   16    3
   54    7   58             22    3   15    2
   57   40  133             40    9    9    2
   57    9   63             30   19   19   12
   69    8   73             45   38   32   27
   71   24  101             39   22   16    9
   71   39  137             43   18   12    5
   71    8   75             46   39   33   28
   79   15   91             31   12   18    7
   79   24  107             34    9   15    4
   88    9   92             27    4   20    3
   92   36  142             49   30   18   11
   97   15  107             47   36   30   23
  111   16  121             32    3   21    2
  111    7  113             29    6   24    5
  119   24  139             39   16   22    9
  119   32  153             44   21   21   10
  119   39  167             43   12   18    5
  119   49  189             48   17   17    6
  130   25  150             45   26   26   15
  134   36  172             48   25   23   12
  141    8  143             45   32   38   27
  145    8  147             46   33   39   28
  150   28  172             41   12   24    7
  150   32  178             42   11   23    6
  154   36  188             48   23   25   12
  167   15  173             47   30   36   23
  179   24  193             40    3   27    2
  179    9  181             36    7   31    6
  212   36  238             49   18   30   11
  253   15  257             43    6   36    5
  253   24  263             45    4   34    3
  274   11  276             44    9   39    8
  274   39  298             50    3   33    2
  321   17  325             48    7   41    6
  321   32  335             51    4   38    3
  376   13  378             51   10   46    9
-------------------------------------------------
    m    k    z              a    b    c    d  
-------------------------------------------------

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

0
On

Here's a python code which can find many solutions to this equation;

from math import isqrt

def is_perfect_square(n):
    return isqrt(n) ** 2 == n

def find_values():
    for m in range(2, 1000):  # Adjust the range as needed
        for k in range(2, m*m):
            expression_1 = m**2 + 9*k**2 + k
            expression_2 = m**2 + 9*k**2 - k
            square_root_1 = isqrt(expression_1)
            square_root_2 = isqrt(expression_2)
            if is_perfect_square(expression_1) and 2 < k < m**2:
                print(f"m = {m}, k = {k}, m^2 + 9k^2 + k = {expression_1}, 
Square root = {square_root_1}")
            if is_perfect_square(expression_2) and 2 < k < m**2:
                print(f"m = {m}, k = {k}, m^2 + 9k^2 - k = {expression_2}, 
Square root = {square_root_2}")

find_values()

I ran it and found many solutions;

m = 4, k = 3, m^2 + 9k^2 + k = 100, Square root = 10
m = 6, k = 5, m^2 + 9k^2 - k = 256, Square root = 16
m = 6, k = 7, m^2 + 9k^2 + k = 484, Square root = 22
m = 8, k = 9, m^2 + 9k^2 - k = 784, Square root = 28
m = 9, k = 7, m^2 + 9k^2 + k = 529, Square root = 23
m = 9, k = 16, m^2 + 9k^2 + k = 2401, Square root = 49
m = 11, k = 9, m^2 + 9k^2 - k = 841, Square root = 29
m = 11, k = 24, m^2 + 9k^2 + k = 5329, Square root = 73
m = 13, k = 15, m^2 + 9k^2 + k = 2209, Square root = 47
m = 13, k = 24, m^2 + 9k^2 - k = 5329, Square root = 73
m = 14, k = 11, m^2 + 9k^2 + k = 1296, Square root = 36
m = 14, k = 39, m^2 + 9k^2 + k = 13924, Square root = 118
m = 15, k = 17, m^2 + 9k^2 - k = 2809, Square root = 53
m = 15, k = 32, m^2 + 9k^2 - k = 9409, Square root = 97
m = 16, k = 13, m^2 + 9k^2 - k = 1764, Square root = 42
m = 16, k = 51, m^2 + 9k^2 + k = 23716, Square root = 154
m = 19, k = 15, m^2 + 9k^2 + k = 2401, Square root = 49
m = 19, k = 72, m^2 + 9k^2 + k = 47089, Square root = 217
m = 20, k = 3, m^2 + 9k^2 + k = 484, Square root = 22
m = 20, k = 23, m^2 + 9k^2 + k = 5184, Square root = 72
m = 20, k = 36, m^2 + 9k^2 + k = 12100, Square root = 110
m = 20, k = 57, m^2 + 9k^2 - k = 29584, Square root = 172
m = 21, k = 17, m^2 + 9k^2 - k = 3025, Square root = 55
m = 21, k = 88, m^2 + 9k^2 + k = 70225, Square root = 265
m = 22, k = 25, m^2 + 9k^2 - k = 6084, Square root = 78
m = 22, k = 69, m^2 + 9k^2 - k = 43264, Square root = 208
m = 24, k = 7, m^2 + 9k^2 + k = 1024, Square root = 32
m = 24, k = 9, m^2 + 9k^2 - k = 1296, Square root = 36
m = 24, k = 19, m^2 + 9k^2 + k = 3844, Square root = 62
m = 24, k = 44, m^2 + 9k^2 - k = 17956, Square root = 134
m = 24, k = 52, m^2 + 9k^2 + k = 24964, Square root = 158
m = 24, k = 115, m^2 + 9k^2 + k = 119716, Square root = 346
m = 26, k = 21, m^2 + 9k^2 - k = 4624, Square root = 68
m = 26, k = 135, m^2 + 9k^2 + k = 164836, Square root = 406
m = 27, k = 31, m^2 + 9k^2 + k = 9409, Square root = 97
m = 27, k = 104, m^2 + 9k^2 - k = 97969, Square root = 313
m = 28, k = 60, m^2 + 9k^2 - k = 33124, Square root = 182
m = 29, k = 23, m^2 + 9k^2 + k = 5625, Square root = 75
m = 29, k = 33, m^2 + 9k^2 - k = 10609, Square root = 103
m = 29, k = 120, m^2 + 9k^2 - k = 130321, Square root = 361
m = 29, k = 168, m^2 + 9k^2 + k = 255025, Square root = 505
m = 31, k = 9, m^2 + 9k^2 - k = 1681, Square root = 41
m = 31, k = 16, m^2 + 9k^2 - k = 3249, Square root = 57
m = 31, k = 25, m^2 + 9k^2 - k = 6561, Square root = 81
m = 31, k = 56, m^2 + 9k^2 + k = 29241, Square root = 171
m = 31, k = 87, m^2 + 9k^2 + k = 69169, Square root = 263
m = 31, k = 192, m^2 + 9k^2 + k = 332929, Square root = 577
m = 34, k = 4, m^2 + 9k^2 - k = 1296, Square root = 36
m = 34, k = 27, m^2 + 9k^2 + k = 7744, Square root = 88
m = 34, k = 32, m^2 + 9k^2 + k = 10404, Square root = 102
m = 34, k = 39, m^2 + 9k^2 + k = 14884, Square root = 122
m = 34, k = 165, m^2 + 9k^2 - k = 246016, Square root = 496
m = 34, k = 231, m^2 + 9k^2 + k = 481636, Square root = 694
m = 35, k = 64, m^2 + 9k^2 - k = 38025, Square root = 195
m = 35, k = 111, m^2 + 9k^2 + k = 112225, Square root = 335
m = 36, k = 4, m^2 + 9k^2 + k = 1444, Square root = 38
m = 36, k = 29, m^2 + 9k^2 - k = 8836, Square root = 94
m = 36, k = 36, m^2 + 9k^2 + k = 12996, Square root = 114
m = 36, k = 41, m^2 + 9k^2 - k = 16384, Square root = 128
m = 36, k = 185, m^2 + 9k^2 - k = 309136, Square root = 556
m = 36, k = 259, m^2 + 9k^2 + k = 605284, Square root = 778
m = 37, k = 80, m^2 + 9k^2 + k = 59049, Square root = 243
m = 37, k = 105, m^2 + 9k^2 - k = 100489, Square root = 317

So, from this (and more computing) we can se that the values of $m$ which satisfy this equation are

4,6,8,9,11,13,14,15,16,19,20,21,22,24,26,27,28,29,31,34,35,36,37,39,41,42,43,44,46,48,49,50,51,53,54,55,56,57,59,60,61,62,63,64,65,66,67,68,69,71,73,74,75,76,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,94,96,97,98,99,101,102,104,105,106,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,136,139,140,141,142,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,171,173,174,176,178,179,180,181,183,184,185,186,187,188,189,190,191,193,194,195,196,197,198,199,200,201,202,203,204,206,207,208,209,210,211,212,214,216,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,243,244,245,246,249,250,251,252,253,254,255,256

Now, lets look at the values of $m$ that don't give a solution, which is a much shorter list;

5,7,10,12,17,18,23,25,30,32,33,38,40,45,47,52,58,70,72,77,87,95,100,103,107,110,135,137,138,143,147,170,172,175,177,182,192,205,213,215,217,220,238,242,247,248,257

It doesn't seem that this sequence of missing numbers will stop, so I don't think there will ever be a point after which each $m$ gives us a solution.