Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Ascending-primes/PicoLisp/ascending-primes.l
Normal file
23
Task/Ascending-primes/PicoLisp/ascending-primes.l
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(de prime? (N)
|
||||
(or
|
||||
(= N 2)
|
||||
(and
|
||||
(> N 1)
|
||||
(bit? 1 N)
|
||||
(for (D 3 T (+ D 2))
|
||||
(T (> D (sqrt N)) T)
|
||||
(T (=0 (% N D)) NIL) ) ) ) )
|
||||
(let
|
||||
(D 2
|
||||
L (1 2 2 . (4 2 4 2 4 6 2 6 .))
|
||||
Lst
|
||||
(make
|
||||
(while (>= 23456789 D)
|
||||
(and
|
||||
(prime? D)
|
||||
(apply < (chop D))
|
||||
(link D) )
|
||||
(inc 'D (++ L)) ) ) )
|
||||
(let Fmt (need 10 10)
|
||||
(while (cut 10 'Lst)
|
||||
(apply tab @ Fmt) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue