P466
projecteuler.net

Distinct Terms in a Multiplication Table

ℹ️Published on Sunday, 6th April 2014, 07:00 am; Solved by 360;
Difficulty rating: 65%

Let $P(m,n)$ be the number of distinct terms in an $m\times n$ multiplication table.

For example, a $3\times 4$ multiplication table looks like this:

$\times$ 1234
1 1234
2 2468
3 36912

There are $8$ distinct terms $\{1,2,3,4,6,8,9,12\}$, therefore $P(3,4) = 8$.

You are given that:
$P(64,64) = 1263$,
$P(12,345) = 1998$, and
$P(32,10^{15}) = 13826382602124302$.

Find $P(64,10^{16})$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.