%I #11 Apr 12 2021 17:46:50
%S 1,0,1,2,0,1,4,0,2,7,0,3,2,9,0,4,13,0,5,3,13,20,0,6,5,18,1,10,4,18,28,
%T 0,7,24,1,12,7,26,1,13,33,0,8,13,36,0,9,32,2,19,7,31,3,22,7,33,54,0
%N a(1)=1. Thereafter, if a(n) is a novel term a(n+1) = number of prior terms > a(n); otherwise a(n+1) = number of prior terms <= a(n).
%C The definition implies that the sequence is infinite, and a(n+1) < n for all n. Conjecture: Zero occurs infinitely many times.
%H Michael De Vlieger, <a href="/A342909/b342909.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael De Vlieger, <a href="/A342909/a342909.png">Scatterplot of a(n)</a> for 1 <= n <= 2^16.
%H Michael De Vlieger, <a href="/A342909/a342909_1.png">Scatterplot of a(n)</a> for 1 <= n <= 2^16, with even n shown in red and odd n shown in blue.
%e a(1)=1, the first novel term. The number of prior terms > 1 is 0, so a(2)=0. a(3) = 1, because a(2) = 0 is a novel term and there is only one term (a(1)=1)>0. Since a(3) = 1 has been seen before a(4)= 2, the number of prior terms (1,0) which are <=1.
%t Block[{a = {1}, k}, Do[k = a[[-1]]; AppendTo[a, If[FreeQ[Most@ a, k], Count[a, _?(# > k &)], -1 + Count[a, _?(# <= k &)]]], 57]; a] (* _Michael De Vlieger_, Mar 28 2021 *)
%K nonn,look
%O 1,4
%A _David James Sycamore_, Mar 28 2021