基于这个Math.SE问题;从这个答案复制的数字。当然,号码来自Numberphile视频。
您的任务是输出以下1350位数的素数:
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888111111111111111111111111888888111111111111111111111111888888111111811111111118111111888888111118811111111118811111888888111188811111111118881111888888111188811111111118881111888888111888811111111118888111888888111888881111111188888111888888111888888111111888888111888888111888888888888888888111888888111888888888888888888111888888111888888888888888888111888888811188888888888888881118888188811188888888888888881118881188881118888888888888811188881118888111888888888888111888811111888811118888888811118888111111188881111111111111188881111111118888111111111111888811111111111888811111111118888111111111111188881111111188881111111111111118888811118888811111111111111111888881188888111111111111111111118888888811111111111111111111111888888111111111111111111111111118811111111111111111111111111111111111111111111062100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001您可以选择在输出中包括换行符。
发布于 2017-09-08 00:35:55
“ßṪṭAƭẠvµM⁾ṖOḥ⁻Ɠ×Ṣ~*pṭẒFỵṿ¦4ÇḟọLÑOcKɲ⁶2*Ḣɲ’b45;@€1ẋ/€ø“Œ\⁴rrNỊġ:,xƙŒ#ṠƲQçḷĠ%&⁻ɼiḂŀB<Ȧƈg(Ṇb>TḥḄ|ḃṘƬ#l7ƇØṃ’b94;@€8ẋ/€ðżF;0;6;2;1;0ẋ445¤;1Ḍ“ßṪṭ...*Ḣɲ’b45;@€1ẋ/€ø“Œ\⁴...ƇØṃ’b94;@€8ẋ/€ðżF;0;6;2;1;0ẋ445¤;1Ḍ Main link
“ßṪṭ...*Ḣɲ’b45;@€1ẋ/€ Run-length encoded 1s
“ßṪṭ...*Ḣɲ’ The base-45 encoding of the list of the run-lengths of 1s
b45 in base 45
€ For each element
;@ prepend
1 1
€ For each sublist
/ Reduce over
ẋ Repeat list (this gets a bunch of lists of 1s)
ø“Œ\⁴...ƇØṃ’b94;@€8ẋ/€ Run-length encoded 8s
“Œ\⁴...ƇØṃ’ The base-94 encoding of the list of the run-lengths of 8s
b94 in base 94
€ For each element
;@ prepend
8 8
€ For each sublist
/ Reduce over
ẋ Repeat list (this gets a bunch of lists of 8s)
ðżF;0;6;2;1;0ẋ445¤;1Ḍ With both of the previous lists of lists, construct the final string
ż Interleave them
F Flatten it
;0 Append 0
;6 Append 6
;2 Append 2
;1 Append 1
; Append
0ẋ445¤ (Nilad)
0 0
ẋ445 445 times
;1 Append 1
Ḍ Convert decimal digits to a number-121个字节,这要感谢Dennis使用“...’文本而不是正常数字
发布于 2017-09-08 00:18:42
s=(map("8"&(*),[93,6,6,1,1,6,2,2,6,3,3,6,3,3,6,4,4,6,5,5,6,6,6,6,18,6,18,6,18,7,16,4,3,16,3,4,14,4,4,12,4,4,8,4,4,4,4,4,4,4,4,4,5,5,5,5,8,6,2]),map("1"&(*),[24,24,6,10,6,5,10,5,4,10,4,4,10,4,3,10,3,3,8,3,3,6,3,3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,3,3,5,4,4,7,14,9,12,11,10,13,8,15,4,17,2,20,23,26,44]))
q=''.join(s[0][i]+s[1][i]for i:0..len(s[0]))
print(q+'0621'+'0'*445+'1')发布于 2017-10-13 17:56:39
•ŒÆÿ¹т£Ƶ‘β\,ä¸γλaX뫊¸þaγG(žÃÇ…»šKþÈ/?`'•20BS20öDg81s∍Ss×J30ôø.∞0D445×621s1J从丹尼斯那偷了这个:
888888888888888811111111111111
888888888888888888111111111111
888888888888888888811111111111
888111111111111888881111111111
888111111111111118888111111111
888111111111111111888811111111
888111111888888111188881111111
888111188888888881118888111111
888111888888888888111888811111
888118888888888888811188881111
888111111188888888811118881111
888111111118888888881111888111
888111111111888888881111888811
888111111111888888881111188811
888111111111888888881111118881注意到它总是介于8和1之间,所以我计算了每次运行的长度(基本20):
['G', 'E', 'I', 'C', 'J', 'B', '3', 'C', '5', 'A', '3', 'E', '4', '9', '3', 'F', '4', '8', '3', '6', '6', '4', '4', '7', '3', '4', 'A', '3', '4', '6', '3', '3', 'C', '3', '4', '5', '3', '2', 'E', '3', '4', '4', '3', '7', '9', '4', '3', '4', '3', '8', '9', '4', '3', '3', '3', '9', '8', '4', '4', '2', '3', '9', '8', '5', '3', '2', '3', '9', '8', '6', '3', '1']将其全部连接在一起,并将其转换为基-10整数:
3954184379309026812828704944878416720438306456270310298603957651230861078960874182787979106461将其进一步压缩为基255:
ŒÆÿ¹т£Ƶ‘β\,ä¸γλaX뫊¸þaγG(žÃÇ…»šKþÈ/?`'然后,在创建压缩位之后..。我们只需要把它调回原样..。
20B # Back to base 20.
S # Each char separate...
20ö # As their base 10 values...
Dg81s∍ # Extend '81' to the length of the array.
Ss×J # Push that many 8 or 1's as told by the array.
30ôø.∞ # Split by the symmetrical pattern, flip it, mirror.
0D445×621s1 # Create the part that doesn't fit into a pattern.
J # Join whole stack together.88888888888888888888888888888
88888888888888888888888888888
88888888888888888888888888888
88811111111111111111111111888
88811111111111111111111111888
88811111181111111118111111888
88811111881111111118811111888
88811118881111111118881111888
88811118881111111118881111888
88811188881111111118888111888
88811188888111111188888111888
88811188888811111888888111888
88811188888888888888888111888
88811188888888888888888111888
88811188888888888888888111888
88881118888888888888881118888
18881118888888888888881118881
18888111888888888888811188881
11888811188888888888111888811
11188881111888888811118888111
11118888111111111111188881111
11111888811111111111888811111
11111188881111111118888111111
11111118888111111188881111111
11111111888881118888811111111
11111111188888188888111111111
11111111111888888811111111111
11111111111188888111111111111
11111111111111811111111111111
11111111111111111111111111111062100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001https://codegolf.stackexchange.com/questions/142066
复制相似问题