freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-466-distinct-terms-in-a-multiplication-table.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.0 KiB
Raw Blame History

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f53e1000cf542c510051 5 false Problem 466: Distinct terms in a multiplication table 302141

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:

× 12341 12342 24683 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,1015) = 13826382602124302.

Find P(64,1016).

Instructions

Tests

tests:
  - text: <code>euler466()</code> should return 258381958195474750.
    testString: assert.strictEqual(euler466(), 258381958195474750);

Challenge Seed

function euler466() {
  // Good luck!
  return true;
}

euler466();

Solution

// solution required