A370408 Lexicographically earliest sequence of positive integers such that no three equal terms appear at distinct indices that are the side lengths of a triangle.
1, 1, 1, 2, 1, 2, 3, 1, 3, 2, 4, 4, 1, 5, 5, 2, 3, 6, 6, 7, 1, 7, 4, 8, 8, 2, 3, 9, 5, 9, 10, 10, 11, 1, 4, 11, 6, 12, 12, 13, 13, 2, 7, 3, 5, 14, 14, 15, 8, 15, 16, 16, 17, 17, 1, 6, 18, 4, 9, 18, 19, 19, 10, 20, 7, 20, 21, 2, 11, 21, 3, 22, 22, 5, 8, 23, 12, 23, 24, 24, 13, 25, 25, 26, 26, 27, 27, 28, 1, 9, 28, 29, 4
Offset: 1
Keywords
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
list={1};Do[k=1;While[lst=Join[list,{k}];!And@@(And@@(({a,b,c}=#;(-a+b+c)(a-b+c)(a+b-c))<=0&/@Subsets[Flatten[Position[lst,#]],{3}])&/@Union@lst),k++];AppendTo[list,k],{n,92}];list (* Giorgos Kalogeropoulos, Feb 20 2024 *)
-
Python
from itertools import combinations as C, count, islice def agen(): # generator of terms yield from [1, 1, 1] sides = {1: [1, 2, 3]} for n in count(4): an = next(an for an in count(1) if an not in sides or all(not all((nMichael S. Branicky, Feb 24 2024
Extensions
More terms from Giorgos Kalogeropoulos, Feb 20 2024
Comments