freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-361-subsequence-of-...

49 lines
1.1 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: 5900f4d51000cf542c50ffe8
title: 问题361Thue-Morse序列的子序列
challengeType: 5
videoUrl: ''
dashedName: problem-361-subsequence-of-thue-morse-sequence
---
# --description--
Thue-Morse序列{Tn}是满足以下条件的二进制序列T0 = 0T2n = Tn T2n + 1 = 1-Tn
{Tn}的前几个术语如下01101001100101101001011001101001 ....
我们将{An}定义为整数的排序序列,使得每个元素的二进制表达式在{Tn}中显示为子序列。例如十进制数18以二进制表示为10010。 10010出现在{Tn}T8到T12因此18是{An}的元素。十进制数14以二进制表示为1110。 1110永远不会出现在{Tn}中因此14不是{An}的元素。
An的前几个术语如下n0123456789101112 ... An012345691011121318 ...
我们还可以验证A100 = 3251和A1000 = 80852364498。
找到最后9位数。
# --hints--
`euler361()`应该返回178476944。
```js
assert.strictEqual(euler361(), 178476944);
```
# --seed--
## --seed-contents--
```js
function euler361() {
return true;
}
euler361();
```
# --solutions--
```js
// solution required
```