Question: Design a program in c++ to answer the following questions: Is it possible to find a permutation for the number 123456789 such that the left

Design a program in c++ to answer the following questions:

Is it possible to find a permutation for the number 123456789 such that the left most digit is evenly divisible by 1, the 2 most left digits are evenly divisible by 2, the 3 left most digits are divisible by 3 and so on?

For example, in 123456789, 1 is evenly divisible by 1, 12 is evenly divisible by 2, 123 is evenly divisible by 3, but because 1234 is not evenly divisible by 4 this number is not a solution to the question.

Second, is it possible to find a similar permutation given the number 1234567890? Finally, is it possible to find a similar permutation for any of the given hexadecimal numbers, 1234567890AB, 1234567890ABC, 1234567890ABCD, 1234567890ABCDE, 1234567890ABCDEF?

program must provide the following functionality and adhere to the following constraints:

program should output The count of the possible solutions for 1,2,3,4,5,6, and 7 digit numbers using the digits 1-9 Example: For a 1 digit number there are 9 possible solutions

All possible solutions for 8 and 9 digit numbers in decimal format using the digits 1-9

All possible solutions for 10 digit numbers in decimal format using the digits 0-9 All possible solutions for 11,12,13,14,15, and 16 digit numbers in hexadecimal format using the digits 0-F

No digit can be used more than once per number

All output should be outputted to the terminal You may not hardcode the solutions to these questions into your program. The solution must be determined as a result of your program checking numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!