Files
freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-167-investigating-ulam-sequences.russian.md

56 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f4141000cf542c50ff26
challengeType: 5
title: 'Problem 167: Investigating Ulam sequences'
videoUrl: ''
localeTitle: 'Задача 167: Исследование последовательностей Улама'
---
## Description
<section id="description"> Для двух положительных целых чисел a и b последовательность Улама U (a, b) определяется U (a, b) 1 = a, U (a, b) 2 = b и для k&gt; 2, U (a, b ) k - наименьшее целое число, большее U (a, b) (k-1), которое может быть записано ровно в одном виде как сумма двух разных предыдущих членов U (a, b). Например, последовательность U (1,2) начинается с 1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2 + 4, 8 = 2 + 6, 11 = 3 + 8; 5 не принадлежит ему, поскольку 5 = 1 + 4 = 2 + 3 имеет два представления в виде суммы двух предыдущих членов, равно 7 = 1 + 6 = 3 + 4. Найти ΣU (2,2n + 1) k для 2 ≤ n ≤ 10, где k = 1011. </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler167()</code> должен вернуть 3916160068885.
testString: 'assert.strictEqual(euler167(), 3916160068885, "<code>euler167()</code> should return 3916160068885.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler167() {
// Good luck!
return true;
}
euler167();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>