chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,42 +1,65 @@
|
||||
---
|
||||
id: 59c3ec9f15068017c96eb8a3
|
||||
title: Farey序列
|
||||
title: Farey sequence
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302266
|
||||
dashedName: farey-sequence
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
<p>编写一个返回n阶Farey序列的函数。该函数应该有一个参数n。它应该将序列作为数组返回。阅读以下内容了解更多详情: </p><p>阶数n的<a href='https://en.wikipedia.org/wiki/Farey sequence' title='wp:Farey序列'>Farey序列</a> F <sub>n</sub>是在0和1之间的完全减少的分数的序列,当在最低阶段时,具有小于或等于n的分母,按照增大的大小排列。 </p><p> Farey序列有时被错误地称为Farey系列。 </p><p>每个Farey序列: </p><p> :: *以值0开头,由分数$ \ frac {0} {1} $表示</p><p> :: *以值1结尾,由$ \ frac {1} {1} $分数表示。 </p><p>订单1到5的Farey序列是: </p><p> $ {\ bf \ it {F}} _ 1 = \ frac {0} {1},\ frac {1} {1} $ </p><p></p><p> $ {\ bf \ it {F}} _ 2 = \ frac {0} {1},\ frac {1} {2},\ frac {1} {1} $ </p><p></p><p> $ {\ bf \ it {F}} _ 3 = \ frac {0} {1},\ frac {1} {3},\ frac {1} {2},\ frac {2} {3},\ frac {1} {1} $ </p><p></p><p> $ {\ bf \ it {F}} _ 4 = \ frac {0} {1},\ frac {1} {4},\ frac {1} {3},\ frac {1} {2},\ frac {2} {3},\ frac {3} {4},\ frac {1} {1} $ </p><p></p><p> $ {\ bf \ it {F}} _ 5 = \ frac {0} {1},\ frac {1} {5},\ frac {1} {4},\ frac {1} {3},\ frac {2} {5},\ frac {1} {2},\ frac {3} {5},\ frac {2} {3},\ frac {3} {4},\ frac {4} {5 },\ frac {1} {1} $ </p>
|
||||
The [Farey sequence](https://en.wikipedia.org/wiki/Farey sequence "wp: Farey sequence") <code>F<sub>n</sub></code> of order `n` is the sequence of completely reduced fractions between `0` and `1` which, when in lowest terms, have denominators less than or equal to `n`, arranged in order of increasing size.
|
||||
|
||||
The *Farey sequence* is sometimes incorrectly called a *Farey series*.
|
||||
|
||||
Each Farey sequence:
|
||||
|
||||
<ul>
|
||||
<li>starts with the value 0, denoted by the fraction $ \frac{0}{1} $</li>
|
||||
<li>ends with the value 1, denoted by the fraction $ \frac{1}{1}$.</li>
|
||||
</ul>
|
||||
|
||||
The Farey sequences of orders `1` to `5` are:
|
||||
|
||||
<ul>
|
||||
<li style='list-style: none;'>${\bf\it{F}}_1 = \frac{0}{1}, \frac{1}{1}$</li>
|
||||
<li style='list-style: none;'>${\bf\it{F}}_2 = \frac{0}{1}, \frac{1}{2}, \frac{1}{1}$</li>
|
||||
<li style='list-style: none;'>${\bf\it{F}}_3 = \frac{0}{1}, \frac{1}{3}, \frac{1}{2}, \frac{2}{3}, \frac{1}{1}$</li>
|
||||
<li style='list-style: none;'>${\bf\it{F}}_4 = \frac{0}{1}, \frac{1}{4}, \frac{1}{3}, \frac{1}{2}, \frac{2}{3}, \frac{3}{4}, \frac{1}{1}$</li>
|
||||
<li style='list-style: none;'>${\bf\it{F}}_5 = \frac{0}{1}, \frac{1}{5}, \frac{1}{4}, \frac{1}{3}, \frac{2}{5}, \frac{1}{2}, \frac{3}{5}, \frac{2}{3}, \frac{3}{4}, \frac{4}{5}, \frac{1}{1}$</li>
|
||||
</ul>
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that returns the Farey sequence of order `n`. The function should have one parameter that is `n`. It should return the sequence as an array.
|
||||
|
||||
# --hints--
|
||||
|
||||
`farey`是一种功能。
|
||||
`farey` should be a function.
|
||||
|
||||
```js
|
||||
assert(typeof farey === 'function');
|
||||
```
|
||||
|
||||
`farey(3)`应该返回一个数组
|
||||
`farey(3)` should return an array
|
||||
|
||||
```js
|
||||
assert(Array.isArray(farey(3)));
|
||||
```
|
||||
|
||||
`farey(3)`应该返回`["1/3","1/2","2/3"]`
|
||||
`farey(3)` should return `["1/3","1/2","2/3"]`
|
||||
|
||||
```js
|
||||
assert.deepEqual(farey(3), ['1/3', '1/2', '2/3']);
|
||||
```
|
||||
|
||||
`farey(4)`应该返回`["1/4","1/3","1/2","2/4","2/3","3/4"]`
|
||||
`farey(4)` should return `["1/4","1/3","1/2","2/4","2/3","3/4"]`
|
||||
|
||||
```js
|
||||
assert.deepEqual(farey(4), ['1/4', '1/3', '1/2', '2/4', '2/3', '3/4']);
|
||||
```
|
||||
|
||||
`farey(5)`应返回`["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]`
|
||||
`farey(5)` should return `["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]`
|
||||
|
||||
```js
|
||||
assert.deepEqual(farey(5), [
|
||||
|
Reference in New Issue
Block a user