作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
虽然它与编程不是很相关,但我认为它可能会有一些帮助:
A zeroless pandigital number of base 10 is a number with all the distinct digits 1,2,3,4,5,6,7,8,9. For example, the first zeroless pandigital number of base 10 is 123456789.Find a zeroless pandigital number of base 10 such that the numbers up to the nth digit is divisible by n i.e. the number formed by 1st, 2nd and 3rd digit is divisible by 3, the number formed by 1 to 6 digits is divisible by 6 and so on.
我一开始的想法是假设没有。成为“abcdefghi”并说明 a 可以是"1-9"b 之间的任何数只能是偶数,e 一定是 5 等等。
但我无法找到从这里开始的方法。
任何帮助/或更好的方法将不胜感激
最佳答案
为什么所有的答案都在评论里?我希望我不会因为发布答案而违反某种我不知道的礼节。
(b, d, f, h)
必须是偶数 (2, 4, 6, 8)
以某种顺序,e
必须是 5
,所以 (a, c, g, i)
必须是数字 (1, 3, 7, 9)
以某种顺序。完成这些观察后,只有 4!*4!=576
种可能性,因此请全部检查。
关于math - 一道有趣的数学题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1216725/
我是一名优秀的程序员,十分优秀!