100 个苹果分成 10 堆有多少种分法

let
    源 = List.Accumulate({0..9},{{}},(x,y)=>List.TransformMany(x,each {1..100},(s,c)=>s&{c})),
    自定义1 = List.Transform(源,each List.Sort(_)),
    自定义2 = List.Distinct( 自定义1),
    自定义4 = List.Select(自定义2,each List.Sum(_)=100),
    自定义3 = List.Count(自定义4)
in
    自定义3

剪枝问题:

let
    源 = List.Accumulate({0..9},{{}},(x,y)=>List.TransformMany(x,each if _={} then {1..100} else if y<9 and List.Sum(_)<100 then {_{y-1}..100-List.Sum(_)} else  if 100-List.Sum(_)>0 then {100-List.Sum(_)} else {},(s,c)=>s&{c})),
    自定义1 = List.Distinct(List.Transform(源, List.Sort)),
    转换为表 = Table.FromList(自定义1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    自定义2 = Table.RowCount(转换为表)
in
    自定义2

结果截图:
file