Files
freeCodeCamp/curriculum/challenges/ukrainian/10-coding-interview-prep/project-euler/problem-463-a-weird-recurrence-relation.md
2022-04-11 19:34:39 +05:30

1.0 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f53c1000cf542c51004e Завдання 463: Дивне рекурентне співвідношення 5 302138 problem-463-a-weird-recurrence-relation

--description--

Функція f для всіх цілих додатних чисел визначається таким чином:

$$\begin{align} & f(1) = 1 \\ & f(3) = 3 \\ & f(2n) = f(n) \\ & f(4n + 1) = 2f(2n + 1) - f(n) \\ & f(4n + 3) = 3f(2n + 1) - 2f(n) \end{align}$$

Функція S(n) визначається як \sum_{i=1}^{n} f(i).

S(8) = 22 and S(100) = 3604.

Знайдіть S(3^{37}). Введіть останні 9 цифр своєї відповіді.

--hints--

weirdRecurrenceRelation() повинно видати 808981553.

assert.strictEqual(weirdRecurrenceRelation(), 808981553);

--seed--

--seed-contents--

function weirdRecurrenceRelation() {

  return true;
}

weirdRecurrenceRelation();

--solutions--

// solution required