login
A245647
The middle member 'b' of the Pythagorean triples (a,b,c) ordered by increasing c, where the triples consist of a triangular number, a square number and a pentagonal number.
5
4, 12, 105, 2625
OFFSET
1,1
COMMENTS
Next term comes from a triple with c > 10^5.
EXAMPLE
a(1) = 4 as the first such Pythagorean triple is (3,4,5). The next three triples are (9,12,15), (100,105,145), (900,2625,2775).
MATHEMATICA
n=10^3; ppt={}; list={}; pos=1; t[x_]:=(IntegerPart[Sqrt[2*x]])*(IntegerPart[Sqrt[2*x]]+1)/2; ls[x_]:=Length[Sqrt[x]]; lis[x_]:=Length[IntegerPart[Sqrt[x]]]; lp[x_]:=Length[(Sqrt[24*x+1]+1)/6]; lip[x_]:=Length[IntegerPart[(Sqrt[24*x+1]+1)/6]]; Do[y=x+1; z=y+1; While[z<=n, While[z^2<x^2+y^2, z=z+1]; If[z^2==x^2+y^2, AppendTo[ppt, {x, y, z}]]; y=y+1], {x, 1, n}]; While[pos<Length[ppt]+1, a=ppt[[pos, 1]]; b=ppt[[pos, 2]]; c=ppt[[pos, 3]]; If[Or[And[t[a]==a, ls[b]==lis[b], lp[c]==lip[c]], And[t[a]==a, ls[c]==lis[c], lp[b]==lip[b]], And[t[b]==b, ls[a]==lis[a], lp[c]==lip[c]], And[t[b]==b, ls[c]==lis[c], lp[a]==lip[a]], And[t[c]==c, ls[a]==lis[a], lp[b]==lip[b]], And[t[c]==c, ls[b]==lis[b], lp[a]==lip[a]]], AppendTo[list, {a, b, c}]]; pos++]; l=Flatten[Sort[list, #1[[3]]<#2[[3]]&]]; Take[l, {2, -1, 3}](*Finds the terms through a search within all Pythagorean triples with c <= n*)
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
Ivan N. Ianakiev, Jul 28 2014
STATUS
approved