Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.6 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f45b1000cf542c50ff6d 问题238无限的字符串游览 5 problem-238-infinite-string-tour

--description--

使用“Blum Blum Shub”伪随机数生成器创建一系列数字

s0 = 14025256 sn + 1 = sn2 mod 20300713

连接这些数字s0s1s2 ...以创建一个无限长度的字符串w。然后w = 14025256741014958470038053646 ......

对于正整数k如果不存在w的子串其中数字之和等于k则pk被定义为零。如果w的至少一个子字符串存在且数字之和等于k则我们定义pk= z其中z是最早的这种子字符串的起始位置。

例如:

子串1,14,1402 ......具有等于1,5,7...的数字的总和从位置1开始因此p1= p5= p7= ...... = 1。

子串4,402,4025...各自的数字总和等于4,6,11 ......从位置2开始因此p4= p6= p11= ...... = 2。

子串02,0252......各自的数字总和等于2,9...从位置3开始因此p2= p9= ...... = 3。

请注意从位置3开始的子字符串025具有等于7的数字之和但是存在较早的子字符串从位置1开始其数字之和等于7因此p7= 1而不是3。

我们可以验证对于0 <k≤103Σpk= 4742。

求Σpk0 <k≤2·1015。

--hints--

euler238()应该返回9922545104535660。

assert.strictEqual(euler238(), 9922545104535660);

--seed--

--seed-contents--

function euler238() {

  return true;
}

euler238();

--solutions--

// solution required