Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,9 +1,9 @@
|
|||
BEGIN # calculate elements of Sylvestor's Sequence #
|
||||
PR precision 200 PR # set the number of digits for LONG LONG modes #
|
||||
# returns an array set to the forst n elements of Sylvestor's Sequence #
|
||||
BEGIN # calculate elements of Sylvester's Sequence #
|
||||
PR precision 220 PR # set the number of digits for LONG LONG modes #
|
||||
# returns an array set to the first n elements of Sylvester's Sequence #
|
||||
# starting from 2, the elements are the product of the previous #
|
||||
# elements plus 1 #
|
||||
OP SYLVESTOR = ( INT n )[]LONG LONG INT:
|
||||
OP SYLVESTER = ( INT n )[]LONG LONG INT:
|
||||
BEGIN
|
||||
[ 1 : n ]LONG LONG INT result;
|
||||
LONG LONG INT product := 2;
|
||||
|
|
@ -14,8 +14,8 @@ BEGIN # calculate elements of Sylvestor's Sequence #
|
|||
OD;
|
||||
result
|
||||
END;
|
||||
# find the first 10 elements of Sylvestor's Seuence #
|
||||
[]LONG LONG INT seq = SYLVESTOR 10;
|
||||
# find the first 10 elements of Sylvester's Seuence #
|
||||
[]LONG LONG INT seq = SYLVESTER 10;
|
||||
# show the sequence and sum the reciprocals #
|
||||
LONG LONG REAL reciprocal sum := 0;
|
||||
FOR i FROM LWB seq TO UPB seq DO
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
sylvester: function [lim][
|
||||
result: new [2]
|
||||
result: [2]
|
||||
loop 2..lim 'x [
|
||||
'result ++ inc fold result .seed:1 [a b][a * b]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
100H: /* CALCULATE ELEMENTS OF SYLVESTOR'S SEQUENCE */
|
||||
100H: /* CALCULATE ELEMENTS OF SYLVESTER'S SEQUENCE */
|
||||
|
||||
BDOS: PROCEDURE( FN, ARG ); /* CP/M BDOS SYSTEM CALL */
|
||||
DECLARE FN BYTE, ARG ADDRESS;
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
END;
|
||||
END;
|
||||
END ADD$BYTE$TO$LONG$INTEGER;
|
||||
/* FIND THE FIRST 10 ELEMENTS OF SYLVESTOR'S SEQUENCE */
|
||||
/* FIND THE FIRST 10 ELEMENTS OF SYLVESTER'S SEQUENCE */
|
||||
DECLARE ( SEQ$ELEMENT, PRODUCT ) LONG$INTEGER;
|
||||
DECLARE ( I, D ) BYTE;
|
||||
DO D = 2 TO LAST( PRODUCT ); PRODUCT( D ) = 0; END;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue