%I #22 Feb 11 2024 11:36:32
%S 0,0,1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,
%T 1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,1,2,1,3,2,0,0,3,1,2,
%U 1,3,2,0,0,3,1,2,1,3,2,0,0,3
%N Sequence of integers such that there are d terms between pairs of integers d. Cycle through d=0,1,2,3, trying to insert the least unused pair starting at the next free position.
%C After the two initial terms, the sequence enters the cycle (1,2,1,3,2,0,0,3) of length 8.
%C This is the lexicographically earliest (nontrivial) sequence of that type, with a range R={0,...,N}, following the example proposed by Eric Angelini (N=9: A227859), cf. link. Indeed, the ranges R={0,1} or R={0,1,2} are not possible. The range R={0,2} is also possible (cf. link).
%H M. F. Hasler, in reply to E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2013-November/011823.html">Re: Skolem + digits + loop</a>, SeqFan List, Nov 01 2013.
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).
%F a(n) = a(n-8) for n>10. G.f.: -x^3*(3*x^7+2*x^4+3*x^3+x^2+2*x+1) / ((x-1)*(x+1)*(x^2+1)*(x^4+1)). - _Colin Barker_, Nov 02 2013
%e Between a(1)=0 and a(2)=0 there are 0 other terms. Then one can place a(3)=1 and has to set a(5)=1 as to have 1 term in between these two. Then one can set a(4)=2=a(7). Then the next free position is a(6)=3=a(10), etc.
%o (PARI) Vec((3*x^9+2*x^6+3*x^5+x^4+2*x^3+x^2)/(-x^8+1) + O(x^100)) \\ _Colin Barker_, Nov 02 2013
%Y Cf. A227859.
%K nonn,easy
%O 1,4
%A _M. F. Hasler_, Nov 01 2013