* 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.3 KiB
1.3 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f4091000cf542c50ff1b | 问题156:计数数字 | 5 | problem-156-counting-digits |
--description--
从零开始,自然数字在基数10中写下,如下所示:
0 1 2 3 4 5 6 7 8 9 10 11 12 ....
考虑数字d = 1。在我们写下每个数字n后,我们将更新已发生的数字并将此数字称为f(n,1)。那么f(n,1)的第一个值如下:
nf(n,1)00 11 21 31 41 51 61 71 81 91 102 114 125
请注意,f(n,1)永远不等于3。
因此,等式f(n,1)= n的前两个解是n = 0并且n = 1。下一个解决方案是n = 199981。以相同的方式,函数f(n,d)给出在写入数字n之后已经写下的总位数d。
实际上,对于每个数字d≠0,0是方程f(n,d)= n的第一个解。设s(d)是f(n,d)= n的所有解的总和。
你得到s(1)= 22786974071。找到Σs(d)的1≤d≤9。注意:如果对于某些n,对于多于一个d的值,f(n,d)= n,对于d的每个值,再次计算n的这个值。 F(N,d)= N。
--hints--
euler156
应该返回21295121502550。
assert.strictEqual(euler156(), 21295121502550);
--seed--
--seed-contents--
function euler156() {
return true;
}
euler156();
--solutions--
// solution required