0

I am attempting to generate a list of all possible 3-digit numbers that can be made by the numbers 1, 3, 5, 6, 7 and 9. I believe Wolfram should have the ability to give me a list, however, I am not too sure as to what to type. Can anyone help me?

Note: I don't just need the number of 3-digit numbers that can be made, as a combination formula can easily give me the answer to the former. Thanks!

Also no repeated digits please.

bio
  • 638

2 Answers2

1

I am assuming you want them to be unique, that is, you don't want results like $(9,9,9)$.

 numbers = {1,3,5,6,7,9}; 
 result = Permutations[numbers, {3}] 

Then you can do

    Length[result]

and see there are 120 of them.

Note: that this question is better suited for the Mathematica Stack Exchange, but they'd want to see your code / attempts.

Moo
  • 11,311
  • I copy/pasted the top statement in, but WA doesn't understand my query. Can you please link your attempt? – bio Mar 25 '19 at 13:25
  • 1
    https://www.wolframalpha.com/input/?i=Permutations%5B%7B1,3,5,6,7,9%7D,+%7B3%7D%5D. You still haven't answered regarding unique 3 numbers or repeats allowed. Also, I posted Mathematica code. – Moo Mar 25 '19 at 14:34
1

EDIT Okay, now that I'm not trying to type this on a phone keyboard where I can't see the whole thing at once,

Map[Fold[(#1*10+#2)&, 0, #]&, 
    Tuples[{1,3,5,6,7,9},3]]

Trying it on WolframAlpha appears to work.

UPDATE

Without repeated digits:

Map[Fold[(#1*10+#2)&, 0, #]&, 
    Permutations[{1,3,5,6,7,9},{3}]]

WolframAlpha link