OFFSET
1,2
COMMENTS
In a triangle, the sum of any two side lengths is greater than that of the third, so that x + y > z.
LINKS
Eric Angelini and Giorgos Kalogeropoulos, Triangles with digits, Personal blog, March 2024.
EXAMPLE
The first triplet of digits (1, 2, 2) forms an isosceles triangle with basis 1 and sides 2 and 2;
the second triplet (2, 2, 1) forms another isosceles triangle with basis 1 and sides 2 and 2;
the fifth triplet (2, 2, 3) forms another isosceles triangle with basis 3 and sides 2 and 2;
the sixth triplet (2, 3, 4) forms a scalene triangle with sides 2, 3 and 4; etc.
MATHEMATICA
g[1]=1; g[2]=2; g[n_]:=g[n]=(k=1; While[MemberQ[ar=Array[g, n-1], k]|| !And@@(({a, b, c}=#; And@@{a+b>c, b+c>a, a+c>b})&/@Partition[Flatten[IntegerDigits/@Join[ar, {k}]], 3, 1]), k++]; k); Array[g, 80]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Giorgos Kalogeropoulos, Mar 09 2024
STATUS
approved
