Problem 2721. Pandigital Factors (Based on Euler 491)
A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not have a leading zero. Lower level pandigital numbers just contain the digits 0-X, where X is less than 9.
Write a MATLAB script that takes as input the number X, and another integer Y. Determine how many pandigital numbers containing the digits 0-X are evenly divisible by Y. For example, there are thirteen pandigital numbers containing 0-4 that are evenly divisible by 7:
43120
42301
41230
32410
31402
31024
30142
23401
24031
20314
14203
10234
10423The number 03421 does not count. Even though it contains all of the digits 0-4, it has a leading zero. Therefore, the output of pandigit_factors(4,7) would be 13. You do not need to output all of the numbers themselves, just how many of them there are. Good luck!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers39
Suggested Problems
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
171 Solvers
-
Find the largest value in the 3D matrix
1621 Solvers
-
755 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
846 Solvers
-
Rounding off numbers to n decimals
5284 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!