Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -16,13 +16,13 @@ BEGIN
|
|||
result
|
||||
FI # is prime # ;
|
||||
|
||||
LONG INT i := 42;
|
||||
LONG INT n := 0;
|
||||
WHILE n < 42 DO
|
||||
LONG INT count := 0;
|
||||
LONG INT i := 42;
|
||||
WHILE count < 42 DO
|
||||
IF is prime( i ) THEN
|
||||
n +:= 1;
|
||||
count +:= 1;
|
||||
print( ( "n = "
|
||||
, whole( n, -2 )
|
||||
, whole( count, -2 )
|
||||
, " "
|
||||
, whole( i, -19 )
|
||||
, newline
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
(define (prime? n) (= 1 (length (factor (int n)))))
|
||||
(define (commafy n) (reverse (join (explode (reverse (string n)) 3) ",")))
|
||||
|
||||
(let (i 42
|
||||
cnt 0)
|
||||
(while (< cnt 42)
|
||||
(++ i)
|
||||
(when (prime? i)
|
||||
(++ cnt)
|
||||
(println (format "Prime %2d. %18s" cnt (commafy i)))
|
||||
(++ i i))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue