Donald Shell propose len/2
as initial value of the gap, and
then to divide it by 2 at each step. The pseudo-code is thus the following:
gap=len/2 while gap>0: apply InsertionSort, comparing i-gap and i, then i-2gap and i-gap, then i-3gap and i-2gap, etc.
Just like in CombSort, the sequence of values taken by the gap is crucial for Shell sort performance. In some rare pathological cases, the sequence we used above can lead to a O(n^2) performance. Other sequences were proposed: the Hibbard's increments of 2k − 1 lead to a complexity of O(n^(3/2)) in worst cases. Pratt's increments 2^i3^j lead to a O(nlog(n)log(n) performance in worst cases. The existance of a sequence leading to a O(n log(n)) was precluded by Poonen, Plaxton, and Suel. Thanks to this performance, ShellSort is a valid candidate for array of several hundred thousands when correctly implemented.
In our case, the array are ways too small to benefit of these optimizations. If you ever need to do so, take as initial gap the biggest value of the targeted serie still smaller than the array size, and then use decreasing values of the serie.
Interestingly enough, determining the best gap sequence for shell sort turns into a research issue of our century in computer science. For example, an article of 2001 introduces the following sequence, which seems to be optimal in practice for arrays of size up to 10^5: {1, 4, 10, 23, 57, 132, 301, 701, 1750} (Marcin Ciura, Best Increments for the Average Case of Shellsort, 13th International Symposium on Fundamentals of Computation Theory, LNCS 2001; Vol. 2138).