freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-242-odd-triplets.md

28 lines
850 B
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
title: 问题242奇数三胞胎
challengeType: 5
videoUrl: ''
---
# --description--
给定集合{1,2...n}我们将fnk定义为具有奇数元素之和的k元素子集的数量。例如f5,3= 4因为集合{1,2,3,4,5}有四个3元素子集具有奇数元素{1,2,4}{ 1,3,5}{2,3,4}和{2,4,5}。
当所有三个值nk和fnk都是奇数时我们说它们产生奇数三元组\[nkfnk]。
正好有五个奇数三元组n≤10\[1,1f1,1= 1]\[5,1f5,1= 3]\[5,5f 5,5= 1]\[9,1f9,1= 5]和\[9,9f9,9= 1]。
n≤1012有多少奇数三胞胎
# --hints--
`euler242()`应该返回997104142249036700。
```js
assert.strictEqual(euler242(), 997104142249036700);
```
# --solutions--