Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-308-an-amazing-prime-generating-automaton.md
Oliver Eyton-Williams dec409a4bd fix: s/localeTitle/title/g
2020-10-06 23:10:08 +05:30

96 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: 5900f4a11000cf542c50ffb3
challengeType: 5
videoUrl: ''
title: 问题308惊人的生成素数的自动机
---
## Description
<section id="description">
用编程语言Fractran编写的程序包含一个分数列表。
Fractran虚拟机的内部状态是一个正整数该整数最初设置为种子值。 Fractran程序的每次迭代都将状态整数乘以列表中的第一个分数从而将其保留为整数。
例如约翰·霍顿·康威John Horton Conway为黄金一代编写的Fractran程序之一由以下14个部分组成1791
7885
1951年
2338
2933
7729
9523
7719
117
1113
1311
152
17
551
从种子整数2开始程序的连续迭代产生以下序列
1582572519252275425...68430...136860...54432240...
此序列中出现的2的幂是22、23、25...
可以证明该序列中所有2的幂都具有质数指数并且所有质数都以正确的顺序显示为2的幂指数
如果有人使用上面的Fractran程序来解决Project Euler问题7找到第10001个素数那么在该程序产生第210001个素数之前将需要进行几次迭代
</section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler308()</code>应该返回1539669807660924。
testString: assert.strictEqual(euler308(), 1539669807660924);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler308() {
// Good luck!
return true;
}
euler308();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>