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 A343887 #12 Jun 07 2021 18:48:38 %S A343887 1,0,1,1,2,0,1,1,2,3,0,1,1,2,3,5,0,2,2,4,1,3,4,6,0,3,3,6,9,0,3,3,6,9, %T A343887 12,0,4,4,8,3,7,4,7,11,1,5,6,11,16,0,6,6,12,18,0,6,6,12,18,24,0,6,6, %U A343887 12,18,25,0,7,7,14,6,13,7,13,20,2,10,16,18,27,0 %N A343887 a(1) = 1. Thereafter if a(n) is a novel term, a(n+1) = number of prior terms > a(n). If a(n) has been seen already, a(n+1) = a(n) + smallest prior term (which, once used, cannot be used again). %C A343887 The sequence is nontrivial if and only if a(1) > 0. a(n) <= n for n <= 10000, but it is not known if this holds for all n. a(n) + a(n+1) <= n is usually but not always true (first exception is at n=509; a(509) + a(510) = 248 + 311 = 559). %C A343887 For n > 1, a(n) = 0 if and only if a(n-1) is a record novel term, whereas every non-record novel term is followed by a nonzero term. Let S(n) be the set of unused terms prior to a(n), then step function |S(n)| increments +1 at a(k+1), where a(k) is a novel term. S(n) typically contains multiple copies of each unused number, providing a continuously incremented supply of least prior terms to add to repeat leading terms as the sequence extends. This suggests that there is always a next record, and hence that zero occurs infinitely many times. Indices of records: 1, 5, 10, 16, 24, 29, 35, 49, 54, 60, 66, 80, 86, 114, 136, 166, 176, 192, 198, 231, ... %C A343887 If a(k) is a record term, we see a(k), 0, m, m, ... where m is the least member of S(k). Between any consecutive pair of zeros we see either no novel terms, in which case the trajectory climbs quickly to the next record term, or there are novel terms, each of which disturbs and extends the trajectory to the next record (see plots). %H A343887 Michael De Vlieger, <a href="/A343887/b343887.txt">Table of n, a(n) for n = 1..10000</a> %H A343887 Michael De Vlieger, <a href="/A343887/a343887.png">Scatterplot of a(n)</a> for n = 1..2^18. %H A343887 Michael De Vlieger, <a href="/A343887/a343887_1.png">Labeled scatterplot of a(n)</a> for n = 1..2^9 showing records in red, zeros in blue, repeated terms in black, terms instigated by a new previous term in gold, and green otherwise. %e A343887 a(2)=0 since a(1)=1 is a novel term and there are zero terms prior to a(1) which are greater than 1. a(3)=1 since a(2)=0 is a novel term and there is one prior term (a(1)=1) which is > 0. a(4)=1+0=1 because a(3) is a repeat term and the smallest unused prior term is 0. %t A343887 Block[{a = {1}, s = {}}, Do[If[FreeQ[#2, #1], AppendTo[a, Count[#2, _?(# > a[[-1]] &)] ], AppendTo[a, a[[-1]] + First[s] ]; Set[s, Rest@ s]] & @@ {First[#1], #2} & @@ TakeDrop[a, -1]; Set[s, Insert[s, a[[-2]], LengthWhile[s, # < a[[-2]] &] + 1]], 80]; a] (* _Michael De Vlieger_, May 03 2021 *) %Y A343887 Cf. A181391, A341846, A342902. %K A343887 nonn,look %O A343887 1,5 %A A343887 _David James Sycamore_, May 02 2021