Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with(plots):with(combinat):with(ArrayTools):
- partitie := proc (n)
- local P, N, i, j, V, W;
- P := partition(n);
- N := numbpart(n);
- V := Vector(N);
- for i from 1 to N do
- V[i] := NumElems(P[i])
- end do;
- W := Vector(n);
- for j from 1 to n do
- for i from 1 to N do
- if V(i) = j
- then W(j) := W(j)+1;
- else W(j) := W(j);
- end if;
- end do;
- end do;
- listplot(W, style = point)
- end proc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement