* 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>
1.2 KiB
1.2 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f4a81000cf542c50ffbb | 问题316:十进制扩展中的数字 | 5 | problem-316-numbers-in-decimal-expansions |
--description--
令p = p1 p2 p3 ...是无限数的随机数字序列,它们以相等的概率从{0,1,2,3,4,5,6,7,8,9}中选择。
可以看出p对应于实数0.p1 p2 p3 ....
还可以看出,从间隔[0,1)中选择一个随机实数等效于选择一个从{0,1,2,3,4,5,6,7,8, 9}的概率相等。
对于具有d个十进制数字的任何正整数n,令k为最小索引,以使pk,pk + 1,... pk + d-1为n的十进制数字,顺序相同。 同样,令g(n)为k的期望值; 可以证明g(n)总是有限的,有趣的是,总是整数。
例如,如果n = 535,则 对于p = 31415926535897 ....,我们得到k = 9 对于p = 355287143650049560000490848764084685354 ...,我们得到k = 36 等等,我们发现g(535)= 1008。
鉴于此,找到
注意:代表发言权功能。
--hints--
euler316()
应该返回542934735751917760。
assert.strictEqual(euler316(), 542934735751917760);
--seed--
--seed-contents--
function euler316() {
return true;
}
euler316();
--solutions--
// solution required