For a fixed integer $k$, find two triangular numbers $a$ and $ak$

73 Views Asked by At

I have solved this problem for $k=2$, but I tried for $k=3$ and I'm stuck.

To put this in a more specific context, I'll write briefly my solution for $k=2$.

Our goal is to find the positive integer solutions of the equation $2n(n+1)=m(m+1)$. Solving for $n$ yields $$m=\frac{-2+\sqrt{4+8n(n+1)}}4$$ so $1+2n(n+1)$ must be a square. But $1+2n(n+1)=n^2+(n+1)^2$, that is, $n$ is the lesser leg of a Pythagorean triple whose legs are consecutive integers. Some more work leads to a Pell equation, whose solution is related to the continued fraction of $\sqrt2$.

1

There are 1 best solutions below

1
On

Well. Taking $x=2m+1$ and $y=2n+1$ we get $$ x^2 - k y^2 = 1-k. $$ We keep only solutions where both $x,y$ are odd, then we can take $m = (x-1)/2$ and $y=(y-1)/2.$ In all these, there is the solution $x=1, y=1.$ After that, the solutions come with a degree two linear recursion, such as the Fibonacci numbers obey. Oh, if $k$ is a square, there are only finitely many solutions, given by factoring. The simplest of these is $k=3,$ $$ x_{n+2} = 4 x_{n+1} - x_n, $$ $$ y_{n+2} = 4 y_{n+1} - y_n. $$ For $k=5,$ these relations (with multiplier $18$) apply to every third solution, for example $3571 = 18 \cdot 119 - 11.$ For $k=6,$ these relations (with multiplier $10$) apply to every other solution, for example $169 = 10 \cdot 17 - 1.$

jagy@phobeusjunior:~$ ./Pell_Target_Fundamental
  Automorphism matrix:  
    2   3
    1   2

  2^2 - 3 1^2 = 1

 x^2 - 3 y^2 = -2

Sat Aug 20 11:37:52 PDT 2016

x:  1  y:  1 ratio: 1  SEED   KEEP +- 
x:  5  y:  3 ratio: 1.66667
x:  19  y:  11 ratio: 1.72727
x:  71  y:  41 ratio: 1.73171
x:  265  y:  153 ratio: 1.73203
x:  989  y:  571 ratio: 1.73205
x:  3691  y:  2131 ratio: 1.73205
x:  13775  y:  7953 ratio: 1.73205
x:  51409  y:  29681 ratio: 1.73205
x:  191861  y:  110771 ratio: 1.73205
x:  716035  y:  413403 ratio: 1.73205
x:  2672279  y:  1542841 ratio: 1.73205
x:  9973081  y:  5757961 ratio: 1.73205

Sat Aug 20 11:38:52 PDT 2016

 x^2 - 3 y^2 = -2

==============================================================

jagy@phobeusjunior:~$ ./Pell_Target_Fundamental
  Automorphism matrix:  
    9   20
    4   9
  Automorphism backwards:  
    9   -20
    -4   9

  9^2 - 5 4^2 = 1

 x^2 - 5 y^2 = -4

Sat Aug 20 11:42:36 PDT 2016

x:  1  y:  1 ratio: 1  SEED   KEEP +- 
x:  4  y:  2 ratio: 2  SEED   KEEP +- 
x:  11  y:  5 ratio: 2.2  SEED   BACK ONE STEP  -1 ,  1
x:  29  y:  13 ratio: 2.23077
x:  76  y:  34 ratio: 2.23529
x:  199  y:  89 ratio: 2.23596
x:  521  y:  233 ratio: 2.23605
x:  1364  y:  610 ratio: 2.23607
x:  3571  y:  1597 ratio: 2.23607
x:  9349  y:  4181 ratio: 2.23607
x:  24476  y:  10946 ratio: 2.23607
x:  64079  y:  28657 ratio: 2.23607
x:  167761  y:  75025 ratio: 2.23607
x:  439204  y:  196418 ratio: 2.23607
x:  1149851  y:  514229 ratio: 2.23607
x:  3010349  y:  1346269 ratio: 2.23607
x:  7881196  y:  3524578 ratio: 2.23607
x:  20633239  y:  9227465 ratio: 2.23607

Sat Aug 20 11:43:06 PDT 2016

 x^2 - 5 y^2 = -4

jagy@phobeusjunior:~$
============================================================
jagy@phobeusjunior:~$ ./Pell_Target_Fundamental  Automorphism matrix:  
    5   12
    2   5
  Automorphism backwards:  
    5   -12
    -2   5

  5^2 - 6 2^2 = 1

 x^2 - 6 y^2 = -5

Sat Aug 20 11:46:27 PDT 2016

x:  1  y:  1 ratio: 1  SEED   KEEP +- 
x:  7  y:  3 ratio: 2.33333  SEED   BACK ONE STEP  -1 ,  1
x:  17  y:  7 ratio: 2.42857
x:  71  y:  29 ratio: 2.44828
x:  169  y:  69 ratio: 2.44928
x:  703  y:  287 ratio: 2.44948
x:  1673  y:  683 ratio: 2.44949
x:  6959  y:  2841 ratio: 2.44949
x:  16561  y:  6761 ratio: 2.44949
x:  68887  y:  28123 ratio: 2.44949
x:  163937  y:  66927 ratio: 2.44949
x:  681911  y:  278389 ratio: 2.44949
x:  1622809  y:  662509 ratio: 2.44949
x:  6750223  y:  2755767 ratio: 2.44949
x:  16064153  y:  6558163 ratio: 2.44949

Sat Aug 20 11:46:57 PDT 2016

 x^2 - 6 y^2 = -5

jagy@phobeusjunior:~$ 
===================================================

We get more orbits as $k$ increases, although the growth is not steady, it depends more on the number of prime factors of $k-1$ than on simply the size of $k.$ Here is $k=13,$ note $2 \cdot 649 = 1298,$ while $1298 \cdot 2989 - 1 = 3879721.$ Also $1298 \cdot 32605 - 25 = 42321265.$

------------------------------------------------------------------

jagy@phobeusjunior:~$ ./Pell_Target_Fundamental  Automorphism matrix:  
    649   2340
    180   649
  Automorphism backwards:  
    649   -2340
    -180   649

  649^2 - 13 180^2 = 1

 x^2 - 13 y^2 = -12

Sat Aug 20 12:27:58 PDT 2016

x:  1  y:  1 ratio: 1  SEED   KEEP +- 
x:  14  y:  4 ratio: 3.5  SEED   KEEP +- 
x:  25  y:  7 ratio: 3.57143  SEED   KEEP +- 
x:  155  y:  43 ratio: 3.60465  SEED   BACK ONE STEP  -25 ,  7
x:  274  y:  76 ratio: 3.60526  SEED   BACK ONE STEP  -14 ,  4
x:  1691  y:  469 ratio: 3.60554  SEED   BACK ONE STEP  -1 ,  1
x:  2989  y:  829 ratio: 3.60555
x:  18446  y:  5116 ratio: 3.60555
x:  32605  y:  9043 ratio: 3.60555
x:  201215  y:  55807 ratio: 3.60555
x:  355666  y:  98644 ratio: 3.60555
x:  2194919  y:  608761 ratio: 3.60555
x:  3879721  y:  1076041 ratio: 3.60555
x:  23942894  y:  6640564 ratio: 3.60555
x:  42321265  y:  11737807 ratio: 3.60555

Sat Aug 20 12:29:58 PDT 2016

 x^2 - 13 y^2 = -12

jagy@phobeusjunior:~$

note 2 * 649 = 1298   and
    1298 * 2989 - 1 =  3879721

---------------------------------------------------------