Sylvester's sequence: Difference between revisions

Content added Content deleted
m (→‎{{header|Factor}}: small tweak)
(→‎{{header|Factor}}: make output easier on the eyes)
Line 77: Line 77:


"First 10 elements of Sylvester's sequence:" print
"First 10 elements of Sylvester's sequence:" print
10 lsylvester ltake dup [ pprint bl ] leach nl nl
10 lsylvester ltake dup [ . ] leach nl


"Sum of the reciprocals of first 10 elements:" print
"Sum of the reciprocals of first 10 elements:" print
Line 84: Line 84:
<pre>
<pre>
First 10 elements of Sylvester's sequence:
First 10 elements of Sylvester's sequence:
2
2 3 7 43 1807 3263443 10650056950807 113423713055421844361000443 12864938683278671740537145998360961546653259485195807 165506647324519964198468195444439180017513152706377497841851388766535868639572406808911988131737645185443
3
7
43
1807
3263443
10650056950807
113423713055421844361000443
12864938683278671740537145998360961546653259485195807
165506647324519964198468195444439180017513152706377497841851388766535868639572406808911988131737645185443


Sum of the reciprocals of first 10 elements:
Sum of the reciprocals of first 10 elements:
27392450308603031423410234291674686281194364367580914627947367941608692026226993634332118404582438634929548737283992369758487974306317730580753883429460344956410077034761330476016739454649828385541500213920805/27392450308603031423410234291674686281194364367580914627947367941608692026226993634332118404582438634929548737283992369758487974306317730580753883429460344956410077034761330476016739454649828385541500213920806
27392450308603031423410234291674686281194364367580914627947367941608692026226993634332118404582438634929548737283992369758487974306317730580753883429460344956410077034761330476016739454649828385541500213920805/27392450308603031423410234291674686281194364367580914627947367941608692026226993634332118404582438634929548737283992369758487974306317730580753883429460344956410077034761330476016739454649828385541500213920806
</pre>
</pre>

Or, in other words, the sum is <code>2739245...3920805/2739245...3920806</code>.


=={{header|Haskell}}==
=={{header|Haskell}}==