Diophantine Equation for Year 1998 ================================== Here's one I've found on YouTube: m²+3n²=1998m Now, since LHS is non-negative because it is a sum of a square and an integer multiplied by a square. So shoud be 1998, thus: m ≥ 0 Let us find how big m and n can be: m² - 1998m + 3n² = 0 ==> ==> m² - 1998m + 999² +3n = 999² ==> ==> (m - 999)² + 3n² = 999² (1) Now, 3|999 ==> 3| 999² - 3n² = (m - 999)² Because 3 is a prime number 3 | m-999 = m - 3 × 333 ==> 3|m Thus, exists an integer a such that m=3a Plug into (1): (3a - 999)² + 3n² = 999² (2) Now, 9 | 999² and 9 | (3a - 999)² Thus, 9 | 999² - (3a - 999)² = 3n² ==> 3 | n² and there exists an integer b such that n = 3b Plug it into (2): (3a - 999)² + 3(3b)² = 999² ==> ==> (3a - 999)² + 27b² = 999² Divide both sides by 9: (a - 333)² - 3b² = 333² (3) Now, 3 | 333 and 3 | 3b² Thus, 3 | 333² - 3b² = (a - 333)² ==> 3 | a - 333 ==> 3|a Thus, there exists an integer c such that a=3c. Plug it into (3) (3c - 333)² + 3b² = 333² (4) Now, 9 | 333² and 9 | 3b² ==> 3 | b² ==> 3 | b Thus, there exists an integer d such that: b = 3d Plug it into (4): (3c - 333)² + 3(3d)² = 333² ==> ==> (3c - 333)² + 27d² = 333² Divide both sides by 9: (c - 111)² + 3d² = 111² (5) Now, 3 | 111² and 3 | 3b² Thus 3 | 111² - 3d² = (c - 111)² ==> 3 | c - 111 ==> 3 | c Thus, there exists an integer e such that e=3c Plug it into (5): (3e - 111)² + 3d² = 111² (6) Now, 9 | 111² and 8 | (3e - 111)² Thus, 9 | 111² - (3e - 111)² = 3d² ==> 3 | d² ==> 3 | d Thus, there exists an integer f such that d = 3f Pluf it into (6): (3e - 111)² + 3(3f)² = 111² ==> ==> (3e - 111)² + 27f² = 111² Divide both sides by 9: (e - 37)² + 3f² = 37² That means first of all that: (e - 37)² ≤ 37² ==> ==> -37 ≤ e - 37 ≤ 37 ==> ==> 0 ≤ e ≤ 74 Let us use the following table to find possible solutions modulu 37 x | x² | 3x² ------------ 0 | 0 | 0 1 | 1 | 3 2 | 4 | 12 3 | 9 | 27 4 | 16 | 11 5 | 25 | 1 6 | 36 | 34 7 | 13 | 2 8 | 27 | 7 9 | 7 | 21 10 | 26 | 4 11 | 10 | 30 12 | 33 | 25 13 | 21 | 32 14 | 11 | 33 15 | 3 | 9 16 | 34 | 28 17 | 30 | 16 18 | 28 | 19 The values above are enough because x² ≡ (37-x)² mod 37. Let us find values such that for each vaule x in the first column there exists a value y in the second column and z in the third column such that y+z ≡ 0 mod 37 Such values of x are: 0,3,4,5,8,9,10,11,12,13,15,16,17,18 There are so many values, so I prefer to solve it using the following python script: import numpy as np print ("Following are the integer solutions: ") for e in range (0,75): x=e-37 f=np.sqrt((1369-x**2)/3) if abs (f-round(f))<1e-6: m=27*e n=27*f print("(m,n)=(%d,±%d)" %(m,n)) The output of the script is: Following are the integer solutions: (m,n)=(0,±0) (m,n)=(648,±540) (m,n)=(1350,±540) (m,n)=(1998,±0)