2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f53e1000cf542c510051
|
|
|
|
|
title: 'Problem 466: Distinct terms in a multiplication table'
|
2020-11-27 18:02:05 +00:00
|
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
|
forumTopicId: 302141
|
2021-01-13 02:31:00 +00:00
|
|
|
|
dashedName: problem-466-distinct-terms-in-a-multiplication-table
|
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
|
|
|
|
Let P(m,n) be the number of distinct terms in an m×n multiplication table.
|
|
|
|
|
|
|
|
|
|
For example, a 3×4 multiplication table looks like this:
|
|
|
|
|
|
|
|
|
|
× 12341 12342 24683 36912
|
|
|
|
|
|
|
|
|
|
There are 8 distinct terms {1,2,3,4,6,8,9,12}, therefore P(3,4) = 8.
|
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
You are given that: P(64,64) = 1263, P(12,345) = 1998, and P(32,1015) = 13826382602124302.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
Find P(64,1016).
|
|
|
|
|
|
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
|
|
|
|
`euler466()` should return 258381958195474750.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
```js
|
|
|
|
|
assert.strictEqual(euler466(), 258381958195474750);
|
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 euler466() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler466();
|
|
|
|
|
```
|
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|