3

I want to find all integer solutions for $$\frac{n(n-1)}2=m^2-1.$$ The only ones I found are $m=\{2,4,64\}$ and $n=\{3,6,91\}$ meaning $m^2-1=\{3,15,4095\}$, but are they the only ones? If not, are there infinitely many solutions? How could I go about finding solutions?

I noticed that $\{3,15,4095\}$ is a subset of the Ramanujan-Nagell numbers, which they conjetured to be the only ones, appart from $0$ and $1$. Is there now a way for finding solutions for this or even to know if there are infinitely many solutions? Thanks.

Batominovski
  • 50,341
Garmekain
  • 3,204
  • 3
    Notice that $(2n-1)^2-2(2m)^2=-7$. Because $-7$ is prime and $\mathbb{Z}[\sqrt{2}]$ is a unique factorization domain, all solutions $(x,y)\in\mathbb{Z}\times\mathbb{Z}$ to $x^2-2y^2=-7$ satisfy $$x+y,\sqrt{2}=(\pm1\pm 2\sqrt{2}),(3+2\sqrt{2})^n,,$$ where $n$ is an integer. – Batominovski May 06 '20 at 12:57
  • The sequence of $m$ is https://oeis.org/A006452 – lhf May 06 '20 at 13:04
  • $n=m=1 $ is a solution – J. W. Tanner May 06 '20 at 15:21
  • From my comment above, you can show that all solutions $(m,n)\in\mathbb{Z}{>0}\times\mathbb{Z}{>0}$ to the Diophantine equation $$\dfrac{n(n-1)}{2}=m^2-1$$ take the form $(m,n)=(m_k,n_k)$ for some integer $k\geq 0$, where $$m_0:=1,,,,n_0:=1,,$$ $$m_1:=2,,,,n_1:=3,,$$ $$m_2:=4,,,, n_2:=6,,$$ $$m_3:=11,,,,n_3:=16,,$$ $$m_{k}:=6,m_{k-2}-m_{k-4}\text{ for integers }k\geq 4,,$$ and $$n_{k}:=6,n_{k-2}-n_{k-4}-2\text{ for integers }k\geq 4,.$$ Compare this result with the lists obtained in two answers below. – Batominovski May 06 '20 at 16:34

2 Answers2

1

Not a complete answer by any means but also not a comment. Some python code gave me the following set of numbers (for the first $1000000$ natural numbers): $$n \in \{1, 3, 6, 16, 33, 91, 190, 528, 1105, 3075, 6438, 17920, 37521, 104443, 218686, 608736 ... \}$$ The code is:

import sys
import math

n = int(sys.argv[1])
for i in range(1,n):
    S = i*(i-1)/2
    if math.sqrt(S+1)%1.0 == 0:
        print (i)
Aniruddha Deb
  • 4,399
  • 16
  • 32
  • I actually messed up with finding the results... Thanks for opening my eyes even though this is not a complete list. – Garmekain May 06 '20 at 12:59
0

$\dfrac{n(n-1)}2=m^2-1\implies (2 n - 1)^2 - 2 (2 m)^2 = -7$

pari/gp code:

pell_nm()=
{
 D= 2; C= -7;
 Q= bnfinit('x^2-D, 1);
 fu= Q.fu[1]; \\print("Fundamental Unit: "fu);
 N= bnfisintnorm(Q, C); \\print("Fundamental Solutions (Norm): "N"\n");
 for(i=1, #N, ni= N[i];
  for(j=0, 64,
   s= lift(ni*fu^j);
   X= abs(polcoeff(s, 0)); Y= abs(polcoeff(s, 1));  
   if(X^2-D*Y^2==C,
    n= (X+1)/2; m= Y/2;
    if(n==floor(n), if(m==floor(m),
     print("("n", "m")")
    ))
   )
  )
 )
};

Output:

? \r pell_nm.gp
? pell_nm()
(1, 1)
(3, 2)
(16, 11)
(91, 64)
(528, 373)
(3075, 2174)
(17920, 12671)
(104443, 73852)
(608736, 430441)
(3547971, 2508794)
(20679088, 14622323)
(120526555, 85225144)
(702480240, 496728541)
(4094354883, 2895146102)
(23863649056, 16874148071)
(139087539451, 98349742324)
(810661587648, 573224305873)
(4724881986435, 3340996092914)
(27538630330960, 19472752251611)
(160506899999323, 113495517416752)
(935502769664976, 661500352248901)
(5452509717990531, 3855506596076654)
(31779555538278208, 22471539224211023)
(185224823511678715, 130973728749189484)
(1079569385531794080, 763370833270925881)
(6292191489679085763, 4449251270876365802)
(36673579552542720496, 25932136791987268931)
(213749285825577237211, 151143569481047247784)
(1245822135400920702768, 880929280094296217773)
(7261183526579946979395, 5134432111084730058854)
(42321279024078761173600, 29925663386414084135351)
(246666490617892620062203, 174419548207399774753252)
(1437677664683276959199616, 1016591625857984564384161)
(1, 1)
(6, 4)
(33, 23)
(190, 134)
(1105, 781)
(6438, 4552)
(37521, 26531)
(218686, 154634)
(1274593, 901273)
(7428870, 5253004)
(43298625, 30616751)
(252362878, 178447502)
(1470878641, 1040068261)
(8572908966, 6061962064)
(49966575153, 35331704123)
(291226541950, 205928262674)
(1697392676545, 1200237871921)
(9893129517318, 6995498968852)
(57661384427361, 40772755941191)
(336075177046846, 237641036678294)
(1958789677853713, 1385073464128573)
(11416662890075430, 8072799748093144)
(66541187662598865, 47051725024430291)
(387830463085517758, 274237550398488602)
(2260441590850507681, 1598373577366501321)
(13174819082017528326, 9316003913800519324)
(76788472901254662273, 54297649905436614623)
(447556018325510445310, 316469895518819168414)
(2608547637051808009585, 1844521723207478395861)
(15203729803985337612198, 10750660443726051206752)
(88613831186860217663601, 62659440939148828844651)
(516479257317175968369406, 365205985191166921861154)
(3010261712716195592552833, 2128576470207852702322273)
Dmitry Ezhov
  • 1,810