chore(i8n,learn): processed translations

This commit is contained in:
Crowdin Bot
2021-02-06 04:42:36 +00:00
committed by Mrugesh Mohapatra
parent 15047f2d90
commit e5c44a3ae5
3274 changed files with 172122 additions and 14164 deletions

View File

@ -1,24 +1,48 @@
---
id: 595608ff8bcd7a50bd490181
title: 冰雹序列
title: Hailstone sequence
challengeType: 5
videoUrl: ''
forumTopicId: 302279
dashedName: hailstone-sequence
---
# --description--
<p> Hailstone数字序列可以从起始正整数n生成 </p>如果n为1则序列结束。如果n是偶数那么序列的下一个n <code>= n/2</code>如果n是奇数那么序列的下一个n <code>= (3 \* n) + 1</code> <p> (未经证实的) <a href='https://en.wikipedia.org/wiki/Collatz conjecture' title='wpCollatz猜想'>Collatz猜想</a>是任何起始编号的冰雹序列总是终止。 </p><p>冰雹序列也称为冰雹数因为这些值通常受到多个下降和上升如云中的冰雹或者作为Collatz序列。 </p>任务创建例程以生成数字的hailstone序列。使用例程表明对于27号的冰雹序列具有开始与112个元件<code>27, 82, 41, 124</code> ,结束时用<code>8, 4, 2, 1</code>与显示具有最长冰雹序列的数目少于100,000一起序列的长度。 (但不要显示实际的序列!)参见: <a href='http://xkcd.com/710' title='链接http//xkcd.com/710'>xkcd</a> (幽默)。
The Hailstone sequence of numbers can be generated from a starting positive integer, `n` by:
<ul>
<li>If <code>n</code> is <code>1</code> then the sequence ends</li>
<li>If <code>n</code> is <code>even</code> then the next <code>n</code> of the sequence <code>= n/2</code></li>
<li>If <code>n</code> is <code>odd</code> then the next <code>n</code> of the sequence <code>= (3 * n) + 1</code></li>
</ul>
The (unproven) [Collatz conjecture](https://en.wikipedia.org/wiki/Collatz conjecture "wp: Collatz conjecture") is that the hailstone sequence for any starting number always terminates.
The hailstone sequence is also known as hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as the Collatz sequence.
# --instructions--
<ol>
<li>Create a routine to generate the hailstone sequence for a number</li>
<li>Use the routine to show that the hailstone sequence for the number 27 has 112 elements starting with <code>27, 82, 41, 124</code> and ending with <code>8, 4, 2, 1</code></li>
<li>Show the number less than 100,000 which has the longest hailstone sequence together with that sequence's length. (But don't show the actual sequence!)</li>
</ol>
**See also:**
<ul>
<li><a href='https://xkcd.com/710' target='_blank'>xkcd</a> (humourous).</li>
</ul>
# --hints--
`hailstoneSequence`是一个函数。
`hailstoneSequence` should be a function.
```js
assert(typeof hailstoneSequence === 'function');
```
`[[27,82,41,124,8,4,2,1], [351, 77031]]` `hailstoneSequence()`应返回`[[27,82,41,124,8,4,2,1], [351, 77031]]`
`hailstoneSequence()` should return `[[27,82,41,124,8,4,2,1], [351, 77031]]`
```js
assert.deepEqual(hailstoneSequence(), res);