freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-386-maximum-length-of-an-antichain.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.1 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4ef1000cf542c510001 5 false Problem 386: Maximum length of an antichain 302050

Description

Let n be an integer and S(n) be the set of factors of n.

A subset A of S(n) is called an antichain of S(n) if A contains only one element or if none of the elements of A divides any of the other elements of A.

For example: S(30) = {1, 2, 3, 5, 6, 10, 15, 30} {2, 5, 6} is not an antichain of S(30). {2, 3, 5} is an antichain of S(30).

Let N(n) be the maximum length of an antichain of S(n).

Find ΣN(n) for 1 ≤ n ≤ 108

Instructions

Tests

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

Challenge Seed

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

euler386();

Solution

// solution required