function counts = candy_count_matrix_sum ( c, m, n )

  counts = zeros ( c, 1 );

  for i = 1 : m
    for j = 1 : n
      cij = mod ( i + j - 2, c ) + 1;
      counts(cij) = counts(cij) + 1;
    end
  end

  return
end

