OFFSET
2,3
COMMENTS
The problem is: given a square, find a positive integer that, whether added to or subtracted from that square, yields a square. That is, both x^2 + C = y^2 and x^2 - C = z^2. Equivalently: z^2 + C = x^2 and x^2 + C = y^2 (squares in arithmetic progression). This is treated in Fibonacci's 'The book of squares' (Liber Quadratorum (1225) but for rational x,y,z). See the Sigler reference, Proposition 14, pp. 53-74 (note that the formulation of this problem on p. 53 is not correct, 'from a square' should read 'from the same square'). See also van der Waerden, pp. 40-42, and A. Weil, pp. 13-14. The desired number C is called a congruum by Fibonacci (a congruous number in Sigler's translation).
For the history of this problem, see Dickson, pp. 459-472 (he uses the (misleading) term congruent number).
The following solution is based on primitive Pythagorean triangles. (Fibonacci's solution is based on sums of odd squares.) The triangle T(n, m) = 24*C(n, m) will have 0's for those (n, m) not leading to primitive Pythagorean triples.
Addition of the two equations, substitution of y = u + v > 0 and z = |u - v| and division by 2 leads to x^2 = u^2 + v^2. Consider primitive Pythagorean triples (u, v, x) with even v which are pairwise relatively prime. Then also GCD(u,v,x) = 1. A common factor f for u, v and x would lead to a multiplication by f^2 on both sides of the two equations. For primitive Pythagorean triples see A249866. One has u = n^2 - m^2, v = 2*n*m and x = n^2 + m^2 with GCD(n, m) = 1 , n > m >= 1, n + m odd. Then C = C(n, m) = 4*n*m*(n^2 - m^2) = 2*v(n, m)*u(n, m). This is four times the area of the Pythagorean triangle. C is divisible by 4! = 24 (see A020885). Define T(n, m) = C(n, m)/4!, for 2 <= m + 1 <= n. This is the area of the corresponding primitive Pythagorean triangle divided by 6.
The corresponding x = x(n, m), y = y(n, m) and z(n, m) number triangles are given in A222946, A225949 and A258149 respectively.
T(n, m) = n*m*(n^2 - m^2)/6, for m = 1, 2, ..., n-1, has for n >= 2 the minimum value at m = 1, and the next largest value appears for n >= 3 at m = n-1. Note all (n, m) pairs are considered here. The proof of the first part is easy. The proof of T(n, m) - T(n, n-1) > 0, for m = 2, 3, ..., n-2, and n >= 3, is equivalent to n^2*(m-2) + 3*n > m^3 +1 and this is easy to prove with n >= m+2 and m >= 2. Therefore the triangle T(n, m) with 0's attains for even n the smallest nonzero row entry at m = 1, and for odd n the smallest nonzero row entry appears at m = n-1 (last entry).
This allows us to find (after solution of two cubic equations for even and odd n, named ne = ne(N) and no = no(N)) a row number nmin(N) = max(ne(n), no(N)) such that N will not appear in any row n > nmin(N).
The original problem posed to Fibonacci by Giovanni di Palermo (Master John of Palermo) was to find a [rational] square that when increased or decreased by 5 gives a square. Fibonacci gave the solution in his Liber Quadratorum in Proposition 17 (see Sigler, pp. 77-81) as x^2 = (41/12)^2 = 1681/144, y^2 = (49/12)^2 = 2401/144 and z^2 = (31/12)^2 = 961/144. This corresponds to the integer quartet (C; x, y, z) = (720; 41, 49, 31) corresponding to the primitive Pythagorean triple [9, 40, 41]. See the examples for (n, m) = (5, 4).
Comments from Eric Snyder, Feb 07 2023: (Start)
If m+n > 3 and not divisible by 3, then m+n | T(n,m).
Additionally, if 2n-1 > 3 and not divisible by 3, then 2n-1 = 6k+-1, and T(n,n-1) = (2n-1)*P(-+k), where P(-+k) is a generalized pentagonal number (A001318). For example, T(6,5) = 11*P(-2) = 11*5.
T(n,n-1) = A000330(n-1) for n>=2. (End)
REFERENCES
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 2, 1920, pp. 459-472.
L. E. Sigler, Leonardo Pisano, Fibonacci, The book of squares, Academic Press, 1987.
B. L. van der Waerden, A History of Algebra, Springer, 1985, pp. 40-42.
André Weil, Number Theory, An approach through history, From Hammurapi to Legendre, Birkhäuser, 1984, pp. 13-14.
FORMULA
T(n, m) = n*m*(n^2 - m^2)/6 if 2 <= m+1 <= n, n+m odd, GCD(n, m) = 1 and 0 otherwise.
EXAMPLE
The triangle T(n, m) begins:
n\m 1 2 3 4 5 6 7 8 9 10 11
2: 1
3: 0 5
4: 10 0 14
5: 0 35 0 30
6: 35 0 0 0 55
7: 0 105 0 154 0 91
8: 84 0 220 0 260 0 140
9: 0 231 0 390 0 0 0 204
10: 165 0 455 0 0 0 595 0 285
11: 0 429 0 770 0 935 0 836 0 385
12: 286 0 0 0 1190 0 1330 0 0 0 506
...
The smallest nonzero number for each row with even n is T(n, 1), and for odd n it is T(n, n-1).
The above mentioned nmin(N) will for N = 300 be 12.
Therefore, no number > 300 will appear for rows with n > 12.
-----------------------------------------------------
The corresponding quartets (C; x, y, z) are:
n=2: (24; 5, 7, 1),
n=3: (120; 13, 17, 7),
n=4: (240; 17, 23, 7), (336; 25, 31, 17),
n=5: (840; 29, 41, 1), (720; 41, 49, 31),
n=6: (840; 37, 47, 23), (1320; 61, 71, 49),
n=7: (2520; 53, 73, 17), (3696; 65, 89, 23),
(2184; 85, 97, 71),
n=8: (2016; 65, 79, 47), (5280; 73, 103, 7),
(6240; 89, 119, 41), (3360; 113, 127, 97),
n=9: (5544; 85, 113, 41), (9360; 97, 137, 7),
(4896; 145, 161, 127),
n=10: (3960; 101, 119, 79), (10920; 109, 151, 31),
(14280; 149, 191, 89), (6840; 181, 199, 161),
n=11: (10296; 125, 161, 73), (18480; 137, 193, 17),
(22440; 157, 217, 47), (20064; 185, 233, 119),
(9240; 221, 241, 199),
n=12: (6864; 145, 167, 119), (28560; 169, 239, 1),
(31920; 193, 263, 73), (12144; 265, 287, 241),
...
-----------------------------------------------------
The corresponding primitive Pythagorean triples
(u, v, x) are:
n=2: [3, 4, 5],
n=3: [5, 12, 13],
n=4: [15, 8, 17], [7, 24, 25],
n=5: [21, 20, 29],[9, 40, 41],
n=6: [35, 12, 37], [11, 60, 61],
n=7: [45, 28, 53], [33, 56, 65],
[13, 84, 85],
n=8: [63, 16, 65], [55, 48, 73],
[39, 80, 89], [15, 112, 113],
n=9: [77, 36, 85], [65, 72, 97],
[17, 144, 145],
n=10: [99, 20, 101], [91, 60, 109],
[51, 140, 149], [19, 180, 181],
n=11: [117, 44, 125], [105, 88, 137],
[85, 132, 157], [57, 176, 185],
[21, 220, 221],
n=12: [143, 24, 145], [119, 120, 169],
[95, 168, 193], [23, 264, 265],
...
MATHEMATICA
T[n_, m_] /; 2 <= m+1 <= n && OddQ[n+m] && CoprimeQ[n, m] := n*m*(n^2 - m^2)/6; T[_, _] = 0; Table[T[n, m], {n, 2, 12}, {m, 1, n-1}] // Flatten (* Jean-François Alcover, Jun 16 2015, after given formula *)
CROSSREFS
KEYWORD
AUTHOR
Wolfdieter Lang, Jun 11 2015
STATUS
approved