* 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.8 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f3ac1000cf542c50febf | 问题64:奇数期平方根 | 5 | problem-64-odd-period-square-roots |
--description--
所有平方根都是周期性的,当写为连续分数时,可以写成以下形式:
√N= a0 + 1
a1 + 1
a2 + 1
a3 + ......
例如,让我们考虑√23:
√23= 4 +√23 - 4 = 4 + 1 = 4 + 1
1√23-4
1 +√23 - 37
如果我们继续,我们将得到以下扩展:
√23= 4 + 1
1 + 1
3 + 1
1 + 1
8 + ......
该过程可归纳如下:
a0 = 4,
1√23-4=√23+ 47 = 1 +√23-37a1 = 1,
7√23-3= 7(√23+ 3)14 = 3 +√23-32a2= 3,
2√23-3= 2(√23+ 3)14 = 1 +√23-47a3 = 1,
7√23-4= 7(√23+ 4)7 = 8 +√23-4a4= 8,
1√23-4=√23+ 47 = 1 +√23-37a5 = 1,
7√23-3= 7(√23+ 3)14 = 3 +√23-32a6= 3,
2√23-3= 2(√23+ 3)14 = 1 +√23-47a7 = 1,
7√23-4= 7(√23+ 4)7 = 8 +√23-4
可以看出序列是重复的。为简明起见,我们使用符号√23= [4;(1,3,1,8)]来表示块(1,3,1,8)无限重复。
(无理)平方根的前十个连续分数表示为:√2= [1;(2)],周期=1√3= [1;(1,2)],周期=2√5= [2; (4)],期间=1√6= [2;(2,4)],期间=2√7= [2;(1,1,1,4)],期间=4√8= [2; (1,4)],期间=2√10= [3;(6)],期间=1√11= [3;(3,6)],期间=2√12= [3;(2,6 )],period =2√13= [3;(1,1,1,1,6)],period = 5对于N≤13,恰好四个连续分数具有奇数周期。 N≤10000的连续分数有多少个奇数周期?
--hints--
euler64()
应返回1322。
assert.strictEqual(euler64(), 1322);
--seed--
--seed-contents--
function oddPeriodSqrts() {
return true;
}
oddPeriodSqrts();
--solutions--
// solution required