Algorithmic braiding - for mother's day
GolfScript, 33 characters
~\),(@{:^1$[=]:y-.,2//y*^~}*;' '*

The input must be provided on stdin.
Examples (you may test online):
&gt; 7 1
2 3 4 1 5 6 7

&gt; 3 4
3 1 2

&gt; 11 2
2 3 4 5 6 11 1 7 8 9 10