介绍
您的任务是在2的平方根和3的平方根的按位和的连续分数表示中生成前1000个项。
换句话说,准确产生以下列表(但输出格式灵活)
[2, 6, 1, 5, 7, 2, 4, 4, 1, 11, 68, 17, 1, 19, 5, 6, 1, 5, 3, 2, 1, 2, 3, 21, 1, 2, 1, 2, 2, 9, 8, 1, 1, 1, 1, 6, 2, 1, 4, 1, 1, 2, 3, 7, 1, 4, 1, 7, 1, 1, 4, 22, 1, 1, 3, 1, 2, 1, 1, 1, 7, 2, 7, 2, 1, 3, 14, 1, 4, 1, 1, 1, 15, 1, 91, 3, 1, 1, 1, 8, 6, 1, 1, 1, 1, 3, 1, 2, 58, 1, 8, 1, 5, 2, 5, 2, 1, 1, 7, 2, 3, 3, 22, 5, 3, 3, 1, 9, 1, 2, 2, 1, 7, 5, 2, 3, 10, 2, 3, 3, 4, 94, 211, 3, 2, 173, 2, 1, 2, 1, 14, 4, 1, 11, 6, 1, 4, 1, 1, 62330, 1, 17, 1, 5, 2, 5, 5, 1, 9, 3, 1, 2, 1, 5, 1, 1, 1, 11, 8, 5, 12, 3, 2, 1, 8, 6, 1, 3, 1, 3, 1, 2, 1, 78, 1, 3, 2, 442, 1, 7, 3, 1, 2, 3, 1, 3, 2, 9, 1, 6, 1, 2, 2, 2, 5, 2, 1, 1, 1, 6, 2, 3, 3, 2, 2, 5, 2, 2, 1, 2, 1, 1, 9, 4, 4, 1, 3, 1, 1, 1, 1, 5, 1, 1, 4, 12, 1, 1, 1, 4, 2, 15, 1, 2, 1, 3, 2, 2, 3, 2, 1, 1, 13, 11, 1, 23, 1, 1, 1, 13, 4, 1, 11, 1, 1, 2, 3, 14, 1, 774, 1, 3, 1, 1, 1, 1, 1, 2, 1, 3, 2, 1, 1, 1, 8, 1, 3, 10, 2, 7, 2, 2, 1, 1, 1, 2, 2, 1, 11, 1, 2, 5, 1, 4, 1, 4, 1, 16, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 8, 1, 2, 1, 1, 22, 3, 1, 8, 1, 1,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以下对连续分数的一般介绍来自“ 简化连续分数”的挑战。
连续分数是迭代描述分数的表达式。它们可以用图形表示:
或者它们可以表示为值列表:
[a0, a1, a2, a3, ... an]
这种挑战是找出的数字明智的总和的持续分数sqrt(2)
和sqrt(3)
,数字明智的总和定义如下,
采取的十进制表示的数字sqrt(2)
和sqrt(3)
,并获得由数字总和位:
1. 4 1 4 2 1 3 5 6 2 3 ...
+ 1. 7 3 2 0 5 0 8 0 7 5 ...
= 2. 11 4 6 2 6 3 13 6 9 8 ...
然后只保留和的最后一位数字,并将其编译回实数的十进制表示形式
1. 4 1 4 2 1 3 5 6 2 3 ...
+ 1. 7 3 2 0 5 0 8 0 7 5 ...
= 2. 11 4 6 2 6 3 13 6 9 8 ...
-> 2. 1 4 6 2 6 3 3 6 9 8 ...
的数位逐行总和sqrt(2)
和sqrt(3)
因此2.1462633698...
,并且当它与连分数,第一1000个值(即,表示以获得)是在导入部中列出的那些。a0
a999
×⁺Ñ
是行不通。或者×Ѳ$
。