Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.md
gikf 397a9f0c3e fix(curriculum): clean-up Project Euler 462-480 (#43069)
* fix: clean-up Project Euler 462-480

* fix: missing image extension

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-30 08:32:21 -07:00

60 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f53e1000cf542c510051
title: 'Problem 466: Distinct terms in a multiplication table'
challengeType: 5
forumTopicId: 302141
dashedName: problem-466-distinct-terms-in-a-multiplication-table
---
# --description--
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:
$$\begin{array}{c}
× & \mathbf{1} & \mathbf{2} & \mathbf{3} & \mathbf{4} \\\\
\mathbf{1} & 1 & 2 & 3 & 4 \\\\
\mathbf{2} & 2 & 4 & 6 & 8 \\\\
\mathbf{3} & 3 & 6 & 9 & 12
\end{array}$$
There are 8 distinct terms {1, 2, 3, 4, 6, 8, 9, 12}, therefore $P(3, 4) = 8$.
You are given that:
$$\begin{align}
& P(64, 64) = 1\\,263, \\\\
& P(12, 345) = 1\\,998, \text{ and} \\\\
& P(32, {10}^{15}) = 13\\,826\\,382\\,602\\,124\\,302. \\\\
\end{align}$$
Find $P(64, {10}^{16})$.
# --hints--
`multiplicationTable()` should return `258381958195474750`.
```js
assert.strictEqual(multiplicationTable(), 258381958195474750);
```
# --seed--
## --seed-contents--
```js
function multiplicationTable() {
return true;
}
multiplicationTable();
```
# --solutions--
```js
// solution required
```