freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-242-odd-triplets.ru...

56 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f45f1000cf542c50ff71
challengeType: 5
title: 'Problem 242: Odd Triplets'
videoUrl: ''
localeTitle: 'Проблема 242: Нечетные тройки'
---
## Description
<section id="description"> Учитывая множество {1,2, ..., n}, определим f (n, k) как число его k-элементных подмножеств с нечетной суммой элементов. Например, f (5,3) = 4, так как множество {1,2,3,4,5} имеет четыре 3-элементарных подмножества, имеющих нечетную сумму элементов, т.е.: {1,2,4}, { 1,3,5}, {2,3,4} и {2,4,5}. <p> Когда все три значения n, k и f (n, k) нечетны, мы говорим, что они образуют нечетно-триплет [n, k, f (n, k)]. </p><p> Существует ровно пять нечетных триплетов с n ≤ 10, а именно: [1,1, f (1,1) = 1], [5,1, f (5,1) = 3], [5,5, f (5,5) = 1], [9,1, f (9,1) = 5] и [9,9, f (9,9) = 1]. </p><p> Сколько нечетных триплетов существует с n ≤ 1012? </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler242()</code> должен вернуть 997104142249036700.
testString: 'assert.strictEqual(euler242(), 997104142249036700, "<code>euler242()</code> should return 997104142249036700.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler242() {
// Good luck!
return true;
}
euler242();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>