In the grade 7 math curriculum here in Alberta we teach divisibility. I'm trying to write a program to create questions based on the idea of a student being given say, 4 digits, and then choosing one of their own to create say, "the largest number divisible by 5".
I have a few simple ideas. Get a list of 4 numbers...
RandomInteger[{0, 9}, 4]
Arrange them
Permutations[list]
Turn them into numbers...
FromDigits /@ Permutations[list]
I'm sure there must be an elegant way to use Mathematica to do this. I'd need to have the original 4 digits and the answer so I could create the question under program control.
I.E. Given the digits 9, 0, 0, 2 and 1 other digit of your choice, create the largest 5 digit number you can that is divisible by 5.
I'd appreciate any hints or suggestions.
