cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A371060 Lexicographically earliest sequence of distinct terms such that every triplet of successive digits (seen as side lengths) can form a triangle.

Original entry on oeis.org

1, 2, 21, 22, 3, 4, 5, 6, 7, 8, 9, 28, 72, 65, 24, 32, 23, 31, 33, 13, 34, 25, 42, 43, 35, 36, 44, 14, 41, 441, 442, 45, 26, 52, 54, 46, 37, 53, 55, 15, 51, 551, 552, 56, 27, 62, 66, 16, 61, 661, 662, 67, 38, 63, 57, 39, 73, 64, 47, 48, 58, 49, 68, 59, 69, 74, 75, 76, 77, 17, 71, 771, 772
Offset: 1

Views

Author

Keywords

Comments

In a triangle, the sum of any two side lengths is greater than that of the third, so that x + y > z.

Examples

			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.
		

Crossrefs

Cf. A370408.

Programs

  • 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]