Is there a better way to create my rotational-symmetric (180 degrees) rectangles?

I have created a simple way to create rotational-symmetric (180 degrees) rectangles, but my stuffit function bothers me. No matter what I tried, I couldn't get it to work within the recursive function. Can someone show me the way?

stuffit[n_List, k_] :=
Block[{j = n}, For[m = k, m <= Length[j], m += k, j[[m]] = k];
Return[j]]

f[1] := 1
f[k_] := stuffit[Flatten[Table[f[k - 1], {n, (Cyclotomic[k, 1])}]], k]
f[k_, p_] := Partition[f[k], p]

f[6, 6] // MatrixForm


Edit Replaced stuffit with MapAt from kguler's answer below. I used it within the recursive routine. Also, added parameter to the partitioning function to subtract the 3rd parameter from p to take the smaller rectangle: f[6,6,1] skips the rightmost column.

f[1] := 1
f[k_] := MapAt[k &, Flatten[Table[f[k - 1],
{n, (Cyclotomic[k, 1])}]], {k ;;  ;; k}]
f[k_, p_, x_] := Partition[f[k], p][[All, 1 ;; p - x]]

f[6, 6, 0] // MatrixForm (*below*)


$$\left( \begin{array}{cccccc} 1 & 2 & 3 & 4 & 5 & 6 \\ 1 & 4 & 3 & 5 & 1 & 6 \\ 1 & 2 & 5 & 4 & 1 & 6 \\ 1 & 5 & 3 & 2 & 1 & 6 \\ 5 & 2 & 3 & 4 & 1 & 6 \\ 1 & 4 & 3 & 2 & 5 & 6 \\ 1 & 2 & 3 & 5 & 1 & 6 \\ 1 & 4 & 5 & 2 & 1 & 6 \\ 1 & 5 & 3 & 4 & 1 & 6 \\ 5 & 4 & 3 & 2 & 1 & 6 \\ \end{array} \right)$$

The rotational symmetry is 180 degrees using the $k-1$ rectangle (omitting the rightmost column, including the ends of the rows.) I think this is the coolest thing I have ever created because it partitions down and keeps the symmetry. Try 6,4,0 and 6,5,0 and 6,4,1 and 6,5,1

-

ClearAll[stuffit2,stuffit3];
stuffit2[n_List, k_] := MapAt[k &, n, {k ;; ;; k}] (* thanks: Mr.Wizard *)
stuffit3[n_List, k_] := ReplacePart[n, List /@ Range[k, Length[n], k] -> k]
(stuffit2[Range[6], #] & /@ Range[6]) ==
(stuffit3[Range[6], #] & /@ Range[6]) ==  (stuffit[Range[6], #] & /@ Range[6])
(* True *)


Used in the recursive functions:

f2[1] := 1
f2[k_] := stuffit2[Flatten[Table[f2[k - 1], {n, (Cyclotomic[k, 1])}]], k]
f2[k_, p_] := Partition[f2[k], p]

f3[1] := 1
f3[k_] := stuffit3[Flatten[Table[f3[k - 1], {n, (Cyclotomic[k, 1])}]], k]
f3[k_, p_] := Partition[f3[k], p]

f2[6, 6] == f3[6, 6] == f[6, 6]
(* True *)

-
I expect that you can use k ;; ;; k in place of k ;; Length[n] ;; k. – Mr.Wizard May 28 '14 at 6:29
Yes ... thank you @Mr.W. – kglr May 28 '14 at 9:33