Integer partitions
http://bomber0.myid.net/ (토론)님의 2009년 12월 25일 (금) 08:00 판
n := 9
 (* choose the proper moduli for the partition statistics *)
 md := 5
 S[n_] := Partitions[n]
 (*define the rank of a partition with the name "pr"*)
 pr[s_] := Max[s] - Length[s]
 S[9]
 (*partition statistics*)
 Table[Mod[pr[s], md], {s, S[n]}]
 Sort[%]
 (*list of paritions with rank*)
 Do[Print[s, ", rank=", pr[s], "\[Congruent]",
   Mod[Max[s] - Length[s], md], "(mod ", md, ")"], {s, S[n]}]
 (*you will see the partition statistics and list of paritions with \
 rank*)