J, 23 * 0.5 = 11.5
=
       f=.-;@(<@|.@i."0@>:@i.)
       f 5
    5 4 5 3 4 5 2 3 4 5 1 2 3 4 5

J, 11
=

       f=.#~@i.@>:
       f 5
    1 2 2 3 3 3 4 4 4 4 5 5 5 5 5