mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-19 22:01:02 -05:00
1.3 KiB
1.3 KiB
id, title, challengeType, forumTopicId, dashedName
| id | title | challengeType | forumTopicId | dashedName |
|---|---|---|---|---|
| 5900f53d1000cf542c51004f | Problem 464: Möbius-Funktion und Intervalle | 1 | 302139 | problem-464-mbius-function-and-intervals |
--description--
Die Möbius-Funktion, bezeichnet mit μ(n), ist definiert als:
μ(n) = (-1)^{ω(n)}fallsneckfrei ist (wobeiω(n)die Nummer verschiedener Hauptfaktoren vonnist)μ(n) = 0fallsnnicht eckfrei ist.
Lasse P(a, b) die Anzahl der Integer n im Intervall [a, b] sein, so dass μ(n) = 1 gilt.
Lasse N(a, b) die Anzahl der Integer n im Intervall [a, b] sein, so dass μ(n) = -1.
Zum Beispiel P(2, 10) = 2 und N(2, 10) = 4.
Lasse C(n) die Anzahl an Paaren der Integer (a, b) sein, so dass:
1 ≤ a ≤ b ≤ n,99 \times N(a, b) ≤ 100 \times P(a, b), und99 \times P(a, b) ≤ 100 \times N(a, b).
Zum Beispiel C(10) = 13, C(500) = 16\\,676 und C(10\\,000) = 20\\,155\\,319.
Finde C(20\\,000\\,000).
--hints--
mobiusFunctionAndIntervals() sollte 198775297232878 zurückgeben.
assert.strictEqual(mobiusFunctionAndIntervals(), 198775297232878);
--seed--
--seed-contents--
function mobiusFunctionAndIntervals() {
return true;
}
mobiusFunctionAndIntervals();
--solutions--
// solution required