OFFSET
1,4
COMMENTS
After the first 5 initial terms, there starts a cycle of 2x20 terms, (3,2,4,...,9,2,4,...), the two half-cycles differing only in 3 transpositions (3,9), (5,3) and (5,9).
The sequence is not related to the base-10 (or any other) representation of the numbers. The choice of the range {0,...,9} is somewhat arbitrary, the same could be done for other ranges. But one can see that R={0,1} and R={0,1,2} are not possible, while R={0,2} or R={0,1,2,3} for example are possible, see A227860.
LINKS
E. Angelini, Skolem + digits (+ loop), SeqFan List, Nov 01 2013.
EXAMPLE
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.
After setting a(16)=9=a(26), one cannot place the pair (0,0) starting with the next free position a(17), because a(18)=6 is already set. So the pair a(17)=1=a(19) is inserted, and only thereafter the pair (0,0) at a(21)=0=a(22), then another pair (2,2), and so on.
PROG
(PARI) a(n)=digits(8239243567489516170082932453674859161700121)[(n+17)%40+(n<6)*20+1]
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Nov 01 2013
STATUS
approved