Sylvester's sequence: Difference between revisions

Content added Content deleted
m (→‎{{header|Factor}}: small tweak)
Line 74: Line 74:
<lang factor>USING: io kernel lists lists.lazy math prettyprint ;
<lang factor>USING: io kernel lists lists.lazy math prettyprint ;


: lsylvester ( -- list ) 2 [ [ sq ] [ - 1 + ] bi ] lfrom-by ;
: lsylvester ( -- list ) 2 [ dup sq swap - 1 + ] lfrom-by ;


"First 10 elements of Sylvester's sequence:" print
"First 10 elements of Sylvester's sequence:" print