2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f5471000cf542c510059
|
|
|
|
title: 'Problem 474: Last digits of divisors'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 302151
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-474-last-digits-of-divisors
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
For a positive integer n and digits d, we define F(n, d) as the number of the divisors of n whose last digits equal d.
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
For example, F(84, 4) = 3. Among the divisors of 84 (1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84), three of them (4, 14, 84) have the last digit 4.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
We can also verify that F(12!, 12) = 11 and F(50!, 123) = 17888.
|
|
|
|
|
|
|
|
Find F(106!, 65432) modulo (1016 + 61).
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
`euler474()` should return 9690646731515010.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
|
|
|
assert.strictEqual(euler474(), 9690646731515010);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
function euler474() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler474();
|
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|