Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. with(plots):with(combinat):with(ArrayTools):
  2.  
  3. partitie := proc (n)
  4.  
  5. local P, N, i, j, V, W;
  6.  
  7. P := partition(n);
  8. N := numbpart(n);
  9. V := Vector(N);
  10.  
  11. for i from 1 to N do
  12. V[i] := NumElems(P[i])
  13. end do;
  14.  
  15. W := Vector(n);
  16.  
  17. for j from 1 to n do
  18. for i from 1 to N do
  19. if V(i) = j
  20. then W(j) := W(j)+1;
  21. else W(j) := W(j);
  22. end if;
  23. end do;
  24. end do;
  25.  
  26. listplot(W, style = point)
  27.  
  28. end proc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement