"Integer partitions"의 두 판 사이의 차이

수학노트
둘러보기로 가기 검색하러 가기
(피타고라스님이 이 페이지의 이름을 integer partitions로 바꾸었습니다.)
1번째 줄: 1번째 줄:
 
+
<< Combinatorica`<br> (* define a integer you want to investigate *)<br> n := 9<br> S[n_] := Partitions[n]<br> (* define the rank of a partition with the name "pr"*)<br> pr[s_] := Max[s] - Length[s]<br> (* partition statistics *)<br> Sort[Table[Mod[pr[s], 5], {s, S[n]}]]<br> (* list of paritions with rank *)<br> Do[Print[s, ", rank=", pr[s], "\[Congruent]",<br>   Mod[Max[s] - Length[s], 5], "(mod 5)"], {s, S[n]}]<br> (* you will see the partition statistics and list of paritions with \<br> rank *)

2009년 12월 25일 (금) 08:51 판

<< Combinatorica`
(* define a integer you want to investigate *)
n := 9
S[n_] := Partitions[n]
(* define the rank of a partition with the name "pr"*)
pr[s_] := Max[s] - Length[s]
(* partition statistics *)
Sort[Table[Mod[pr[s], 5], {s, S[n]}]]
(* list of paritions with rank *)
Do[Print[s, ", rank=", pr[s], "\[Congruent]",
  Mod[Max[s] - Length[s], 5], "(mod 5)"], {s, S[n]}]
(* you will see the partition statistics and list of paritions with \
rank *)