* 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 |
---|---|---|---|---|
5900f4ae1000cf542c50ffc0 | 问题321:交换计数器 | 5 | problem-321-swapping-counters |
--description--
由2n + 1个正方形组成的水平行在一端有n个红色计数器,在另一端有n个蓝色计数器,中间由一个空的正方形隔开。 例如,当n = 3时。
计数器可以从一个正方形移动到下一个正方形(滑动),也可以跳过另一个计数器(跳),只要该计数器旁边的正方形未被占用即可。
令M(n)表示完全反转彩色计数器位置的最小移动/动作数; 也就是说,将所有红色计数器向右移动,并将所有蓝色计数器向左移动。 可以验证M(3)= 15,它也恰好是三角形数。
如果我们基于n的值创建一个序列,其中M(n)是一个三角形数字,那么前五个项将是: 1、3、10、22和63,它们的总和为99。
找出该序列的前四十项之和。
--hints--
euler321()
应该返回2470433131948040。
assert.strictEqual(euler321(), 2470433131948040);
--seed--
--seed-contents--
function euler321() {
return true;
}
euler321();
--solutions--
// solution required