# [seqfan] Glass worms

Eric Angelini Eric.Angelini at kntv.be
Mon Mar 9 17:07:10 CET 2009

```Hello SeqFans,

Take a finite row of glasses, each one containing an
interger number of liquid-units (zero = empty glass)

Procedure:

- take the leftmost glass,
- consider the number k of liquid-units it contains,
- empty the glass in the k-th glass on it's right,
- put the now empty glass at the right end of the row;
- start the procedure again.

Example :

\ 1 / \ 2 / \ 4 / \ 1 / \ 0 /
\_/   \_/   \_/   \_/   \_/

\ 0 / \ 3 / \ 4 / \ 1 / \ 0 /
\_/   \_/   \_/   \_/   \_/

\ 3 / \ 4 / \ 1 / \ 0 / \ 0 /
c)     \_/   \_/   \_/   \_/   \_/

\ 0 / \ 4 / \ 1 / \ 3 / \ 0 /
d)     \_/   \_/   \_/   \_/   \_/

\ 4 / \ 1 / \ 3 / \ 0 / \ 0 /
e)           \_/   \_/   \_/   \_/   \_/

\ 0 / \ 1 / \ 3 / \ 0 / \ 4 /
f)           \_/   \_/   \_/   \_/   \_/

\ 1 / \ 3 / \ 0 / \ 4 / \ 0 /
g)                 \_/   \_/   \_/   \_/   \_/

\ 0 / \ 4 / \ 0 / \ 4 / \ 0 /
h)                 \_/   \_/   \_/   \_/   \_/

\ 4 / \ 0 / \ 4 / \ 0 / \ 0 /
i)                       \_/   \_/   \_/   \_/   \_/

\ 0 / \ 0 / \ 4 / \ 0 / \ 4 /
j)                       \_/   \_/   \_/   \_/   \_/

\ 0 / \ 4 / \ 0 / \ 4 / \ 0 /
k)                             \_/   \_/   \_/   \_/   \_/

this configuration being the same as (h)

Questions :

Should we represent a glass-configuration as a string of
characters, the above sequence would look like:
(a) 12410 --> (b) 03410 --> (c) 34100 --> (d) 04130 -->
(e) 41300 --> (f) 01304 --> (g) 13040 --> (h) 04040 -->
(i) 40400 --> (j) 00404 --> (k) 04040 --> (h) (loop)

What would be the seq. W(1) of integers (like 12410 or 13040)
which end in a loop?

What would be the seq. W(2) of the smallest integers part
of a loop (like 40400) [We can see those integers as worms
(glasses-worms) moving to the right in successive moltings
-- thus the name of the (french) page here, with the word-
play vers/verre (worm/glas):