# New to Mathmatica and Programming in general (Need guidance)(combinatorics)

Posted 9 years ago
3520 Views
|
2 Replies
|
2 Total Likes
|
 Permutations of [{4, 9, 2, 3, 6}]For example I know there are 120 possibilities. However I can get them to display. I just do not know enough coding and language to sum all the possible permutations. For example I want to add 49236 + 49263 + 49326........................... and so on.I am trying to see if I do this for all 120 combinations I get a PalindromeWhat should I do here?
2 Replies
Sort By:
Posted 9 years ago
 Hi there,the first two commands generate the list and the permutations, just like in Nasser's reply. list = {4, 9, 2, 3, 6}; per = Permutations[list]; Then you need to combine the digits to Integers and add them up: Total[FromDigits /@ per] The result is 6399936 which indeed is palindromic. Cheers,M.
Posted 9 years ago
 Where did you get 49236 + 49263 + 49326... from? since Total[{4, 9, 2, 3, 6}] is 24 and not 49236? Each permutation have the same total, just different arrangement. Either way, to sum them all, you can do list = {4, 9, 2, 3, 6}; per = Permutations [list]; Length[per]*Total[list] which gives 2880 I am trying to see if I do this for all 120 combinations I get a Palindrome I am not sure I understand the above. But to find total of list of numbers, the command is Total.