Message Boards Message Boards

0
|
7001 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I get Permutations of each Integer Partition?

Posted 10 years ago
POSTED BY: Logan Bell
2 Replies

If I understand correctly the question, then you just want to use Map.

Map[Permutations, IntegerPartitions[7]]

(* Out[183]= {{{7}}, {{6, 1}, {1, 6}}, {{5, 2}, {2, 5}}, {{5, 1, 1}, {1, 
   5, 1}, {1, 1, 5}}, {{4, 3}, {3, 4}}, {{4, 2, 1}, {4, 1, 2}, {2, 4, 
   1}, {2, 1, 4}, {1, 4, 2}, {1, 2, 4}}, {{4, 1, 1, 1}, {1, 4, 1, 
   1}, {1, 1, 4, 1}, {1, 1, 1, 4}}, {{3, 3, 1}, {3, 1, 3}, {1, 3, 
   3}}, {{3, 2, 2}, {2, 3, 2}, {2, 2, 3}}, {{3, 2, 1, 1}, {3, 1, 2, 
   1}, {3, 1, 1, 2}, {2, 3, 1, 1}, {2, 1, 3, 1}, {2, 1, 1, 3}, {1, 3, 
   2, 1}, {1, 3, 1, 2}, {1, 2, 3, 1}, {1, 2, 1, 3}, {1, 1, 3, 2}, {1, 
   1, 2, 3}}, {{3, 1, 1, 1, 1}, {1, 3, 1, 1, 1}, {1, 1, 3, 1, 1}, {1, 
   1, 1, 3, 1}, {1, 1, 1, 1, 3}}, {{2, 2, 2, 1}, {2, 2, 1, 2}, {2, 1, 
   2, 2}, {1, 2, 2, 2}}, {{2, 2, 1, 1, 1}, {2, 1, 2, 1, 1}, {2, 1, 1, 
   2, 1}, {2, 1, 1, 1, 2}, {1, 2, 2, 1, 1}, {1, 2, 1, 2, 1}, {1, 2, 1,
    1, 2}, {1, 1, 2, 2, 1}, {1, 1, 2, 1, 2}, {1, 1, 1, 2, 2}}, {{2, 1,
    1, 1, 1, 1}, {1, 2, 1, 1, 1, 1}, {1, 1, 2, 1, 1, 1}, {1, 1, 1, 2, 
   1, 1}, {1, 1, 1, 1, 2, 1}, {1, 1, 1, 1, 1, 2}}, {{1, 1, 1, 1, 1, 1,
    1}}} *)
POSTED BY: Daniel Lichtblau
Posted 10 years ago

Cool! Thanks! :)

POSTED BY: Logan Bell
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract