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.
%I A309797 #33 Nov 14 2019 17:20:08 %S A309797 1,1,1,1,2,2,2,1,1,1,1,3,3,2,2,2,4,2,4,5,4,1,1,1,1,3,3,3,1,6,6,6,7,5, %T A309797 3,2,2,2,2,2,2,4,4,4,4,4,7,5,7,5,8,5,8,8,8,8,3,1,1,1,1,9,9,6,1,1,1,1, %U A309797 10,3,3,3,6,6,6,6,6,7,6,3,9,2,2,2,2,2,2 %N A309797 Lexicographically earliest sequence of positive integers such that for any n > 0 there are no more than a(n) numbers k > 0 such that a(n + k) = a(n + 2*k). %C A309797 The sequence is well defined as we can always extend the sequence with a number that has not yet appeared. %C A309797 The number 1 appears infinitely many times in the sequence: %C A309797 - by contradiction: suppose that m is the index of the last occurrence of 1 in the sequence, %C A309797 - there is no n > 0 such that n + k = m and n + 2*k = 2*m (with k > 0), %C A309797 - so we can choose a(2*m) = 1, QED. %C A309797 This sequence has connections with A003602: %C A309797 - here we have up to a(n) numbers k such that a(n+k) = a(n+2*k), there we have no such numbers, %C A309797 - for any v >= 0, let f_v be the lexicographically earliest sequence of positive integers such that there are no more than v numbers k such that f_v(n + k) = f_v(n + 2*k), %C A309797 - then f_v corresponds to A003602 where all but the first term have been repeated 2*v+1 times. %H A309797 Rémy Sigrist, <a href="/A309797/b309797.txt">Table of n, a(n) for n = 1..10000</a> %H A309797 Rémy Sigrist, <a href="/A309797/a309797.gp.txt">PARI program for A309797</a> %H A309797 Rémy Sigrist, <a href="/A309797/a309797.png">Scatterplot of the first 500000 terms</a> %F A309797 a(n) >= #{ k>0 such that a(n+k) = a(n+2*k) }. %e A309797 The first terms, alongside the corresponding k's, are: %e A309797 n a(n) k's %e A309797 -- ---- ---------- %e A309797 1 1 {1} %e A309797 2 1 {1} %e A309797 3 1 {2} %e A309797 4 1 {1} %e A309797 5 2 {1, 3} %e A309797 6 2 {2, 14} %e A309797 7 2 {1, 2} %e A309797 8 1 {1} %e A309797 9 1 {1} %e A309797 10 1 {4} %e A309797 11 1 {1} %e A309797 12 3 {2, 3, 68} %e A309797 13 3 {1, 4, 22} %e A309797 14 2 {1, 2} %o A309797 (PARI) See Links section. %Y A309797 Cf. A003602, A329268 (positions of 1). %K A309797 nonn,look %O A309797 1,5 %A A309797 _Rémy Sigrist_, Nov 11 2019