freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-88-product-sum-numb...

1.5 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f3c51000cf542c50fed6 5 Problem 88: Product-sum numbers 问题88产品总和数

Description

可以写为至少两个自然数{a1a2...ak}的给定集合的和和乘积的自然数N称为乘积和数N = a1 + a2 + ... + ak = a1×a2×...×ak。例如6 = 1 + 2 + 3 = 1×2×3。对于给定的大小集合k我们将使用此属性调用最小的N作为最小乘积和数。尺寸组k = 2,3,4,5和6的最小乘积和数如下。 k = 24 = 2×2 = 2 + 2k = 36 = 1×2×3 = 1 + 2 + 3k = 48 = 1×1×2×4 = 1 + 1 + 2 + 4k = 58 = 1×1×2×2×2 = 1 + 1 + 2 + 2 + 2k = 612 = 1×1×1×1×2×6 = 1 + 1 + 1 + 1 + 2 +因此对于2≤k≤6所有最小乘积和数之和为4 + 6 + 8 + 12 = 30;请注意8只计算总和一次。实际上由于2≤k≤12的完整最小乘积和数是{4,6,8,12,15,16}因此总和为61.所有最小乘积和的总和是多少数字为2≤k≤12000

Instructions

Tests

tests:
  - text: <code>euler88()</code>应该返回7587457。
    testString: 'assert.strictEqual(euler88(), 7587457, "<code>euler88()</code> should return 7587457.");'

Challenge Seed

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

euler88();

Solution

// solution required