Sylvester's sequence: Difference between revisions
Content added Content deleted
JsfasdF256 (talk | contribs) (Scheme) |
(add parigp) |
||
Line 494: | Line 494: | ||
Sum of the reciprocals of the first 10 terms: 0.9999999999999999</pre> |
Sum of the reciprocals of the first 10 terms: 0.9999999999999999</pre> |
||
=={{header|PARI/GP}}== |
|||
<lang parigp> |
|||
S=vector(10) |
|||
S[1]=2 |
|||
for(i=2, 10, S[i]=prod(n=1,i-1,S[n])+1) |
|||
print(S)</lang> |
|||
{{out}}<pre>[2, 3, 7, 43, 1807, 3263443, 10650056950807, 113423713055421844361000443, 12864938683278671740537145998360961546653259485195807, 165506647324519964198468195444439180017513152706377497841851388766535868639572406808911988131737645185443]</pre> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |