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.

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.

This page as a plain text file.
%I A370408 #41 Mar 06 2024 03:48:31
%S A370408 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,
%T A370408 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,
%U A370408 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
%N 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.
%C A370408 In a triangle, the sum of any two side lengths is greater than that of the third, so that x + y > z.
%C A370408 So if x < y and a(x) = a(y) = t then we cannot have a(z) = t for any z in the range y < z < x+y.
%C A370408 Another way to construct the sequence: Place 1's at the earliest permitted positions (in this case, at Fibonacci indices). Each subsequent value (2’s, 3’s, etc.) is placed at the earliest permitted indices not already occupied by a smaller value. For example, 3's could be placed in a Fibonacci pattern beginning with 7, 9 (7, 9, 16, 25, etc.), but i=7+9=16 is already occupied by the value 2, so 3 gets the next smallest position i=17. i=9+17=26 is again occupied by a 2, so we give 3 the next smallest unoccupied position i=27.
%H A370408 Michael S. Branicky, <a href="/A370408/b370408.txt">Table of n, a(n) for n = 1..10000</a>
%t A370408 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 *)
%o A370408 (Python)
%o A370408 from itertools import combinations as C, count, islice
%o A370408 def agen(): # generator of terms
%o A370408     yield from [1, 1, 1]
%o A370408     sides = {1: [1, 2, 3]}
%o A370408     for n in count(4):
%o A370408         an = next(an for an in count(1) if an not in sides or all(not all((n<b+c, b<n+c, c<n+b)) for b, c in C(sides[an], 2)))
%o A370408         yield an
%o A370408         if an not in sides: sides[an] = []
%o A370408         sides[an].append(n)
%o A370408 print(list(islice(agen(), 93))) # _Michael S. Branicky_, Feb 24 2024
%Y A370408 Cf. A367196, A107572 (triangle side lengths), A100480.
%K A370408 nonn
%O A370408 1,4
%A A370408 _Neal Gersh Tolunsky_, Feb 17 2024
%E A370408 More terms from _Giorgos Kalogeropoulos_, Feb 20 2024