RosettaCodeData/Task/Anti-primes/Transd/anti-primes.transd
2023-07-01 13:44:08 -04:00

19 lines
457 B
Text

#lang transd
MainModule: {
countDivs: (λ n Int() ret_ Int()
(= ret_ 2)
(for i in Range(2 (to-Int (/ (to-Double n) 2) 1)) do
(if (not (mod n i)) (+= ret_ 1)))
(ret ret_)
),
_start: (λ locals: max 0 tmp 0 N 1 i 2
(textout 1 " ")
(while (< N 20)
(= tmp (countDivs i))
(if (> tmp max)
(textout i " ") (= max tmp) (+= N 1))
(+= i 1)
))
}