>>434
やっつけ
target = 6
$result = []
def foo(a, sum, n, depth)
 return if sum < n
 (n..(sum-1)).each do |m|
  foo(a.dup.push(m), sum - m, m, depth + 1)
 end
 $result.push(a.dup.push(sum))
end
foo([], target, 1, 0)
p $result

結果
[[1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 2], [1, 1, 1, 3], [1, 1, 2, 2], [1, 1, 4], [1, 2, 3], [1, 5], [2, 2, 2], [2, 4], [3, 3], [6]]