freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-362-squarefree-fact...

1.2 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f4d61000cf542c50ffe9 5 Problem 362: Squarefree factors 问题362无广义因子

Description

考虑数字54. 54可以用7种不同的方式分解为大于154,2×27,3×18,6×9,3×3×6,2×3×9和2×的一个或多个因子3×3×3。如果我们要求所有因子都是无平方的则只剩下两种方式3×3×6和2×3×3×3。

让我们调用Fsfnn可以计算为一个或多个大于1的无平方因子的方式的数量因此Fsf54= 2。

对于k = 2到n令Sn为ΣFsfk

S100= 193。

找到S10 000 000 000

Instructions

Tests

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

Challenge Seed

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

euler362();

Solution

// solution required