A340462 Triangular numbers that are the hypotenuse of a primitive Pythagorean triple (PPT) such that another member of the triple is also triangular.
325, 49141, 104653, 354061, 3059101, 24735061, 33697945, 72884701, 406509841, 408565405, 1081752841, 1690914781, 3234130525, 4521006505, 4759123141, 6432672025, 10850633641, 27812493325, 33549177061, 39343911841, 49017527065, 145684193005, 157819451653, 221156059645
Offset: 1
Keywords
Examples
a(1) = 325 because 325 is the 25th triangular number and has all its prime factors congruent to 1 (mod 4). It is the sum of two squares m^2 + n^2 where (m,n) = (1,18), (6,17), (10,15). The first and second pair can be used to generate two PPT's (325,323,36) and (325,253,204) and these PPT's contain a second triangular number 36 and 253 respectively.
Links
- Michel Marcus, Corresponding triples
Crossrefs
Cf. A337156.
Programs
-
Mathematica
TriQ[n_] := Module[{m=Floor@Sqrt[2n]}, If[n==m(m+1)/2, True, False]]; flst[n_] := Module[{p, lst={}, p2=Ceiling@Sqrt[n/2], p1=1}, Do[If[IntegerQ[s=Sqrt[n-p^2]]&&s>0&&GCD[s, p]==1&&OddQ[s+p], AppendTo[lst, {p, s}]], {p, p1, p2}]; lst]; lst={}; Do[If[Union@Mod[First/@FactorInteger[p(p+1)/2], 4]=={1}, AppendTo[lst, Map[#[[1]]^2+#[[2]]^2 &, Select[flst[p(p+1)/2], TriQ[2#[[1]]*#[[2]]]||TriQ[#[[2]]^2-#[[1]]^2] &], 1]]], {p, 2, 10^4}]; Union@Flatten@lst
-
PARI
isokt(k) = my(f=factor(k)[, 1]~); for (i=1, #f, if ((f[i]%4) != 1, return (0))); return(1); \\ A337156 isok(h, n) = {if (ispolygonal(h, 3) && isokt(h), for (it=1, n-1, my(i=it*(it+1)/2, c); if (issquare(h^2-i^2, &c) && (gcd([i,c,h]) == 1), return (1););););} lista(nn) = {for (n=1, nn, my(t=n*(n+1)/2); if (isok(t, n), print1(t, ", ")););} \\ Michel Marcus, Apr 25 2021
Comments