Hi Neil, I think you may have missed this little piece of code: PythagoreanTriples[sqNn_] := Select[{sqNn, k, m} /. Solve[ MapThread[#1 == #2 &, {{(sqNn^2)/#, #}, {(m - k), (m + k)}}]][[1]] & /@ Divisors[sqNn^2][[1 ;; -1]], And[And @@ (IntegerQ /@ #), And @@ (# > 0 & /@ #)] &] (*https://oeis.org/A046079*) Length[PythagoreanTriples[#]] & /@ Range[2, 20] Out[] = {0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 4, 3, 1, 2, 1, 4} If you hack out the part that says Solve[...] and maybe put a "d" in for the "#" sign, then you can get that [n,d/2-n^2/(2*d),d/2+n^2/(2*d)], with "d" for divisor. Just to double-check for possible typo, let's try: Expand[{n, d/2 - n^2/(2 d), d/2 + n^2/(2 d)} /. {x_, y_, z_} :>x^2 + y^2 - z^2] Out[]=0 Then, we can refine the idea of an "analog", Pythagorean : Trithagorean :: {n, d/2 - n^2/(2 d), d/2 + n^2/(2 d)} : {n, n*(n + 1)/d - (d + 2)/4, n*(n + 1)/d + (d - 2)/4}. The other relevant sequence is https://oeis.org/A309507, see my message from Sat. Feb 22. --Brad On Thu, Feb 27, 2020 at 3:54 PM Neil Sloane <njasloane@gmail.com> wrote:
I mentioned this on Feb 19 2020 and several people sent very helpful replies.
For squares, we have the theorem that all solutions to x^2+y^2=z^2 in integers are given by Pythagorean triples, t*[u^2-v^2, 2uv, u^2+v^2].
Expanding on the replies from Michael Collins and Rich, it looks like the following is the analog for triangular numbers T_n = n(n+1)/2. ALL solutions to T_n+T_k=T_m are given by the list of what one might call Trithagorean triples: these are the triples
[n,k,m] = [n, T/Q-(Q+1)/2,T/Q+(Q-1)/2] where n >= 2, T=n(n+1)/2, and Q is any odd divisor of T less than n,
plus these triples with the first two coordinates swapped.
I haven't found this in the literature, but it can hardly be new. _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun