Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Amicable-pairs/Transd/amicable-pairs.transd
Normal file
19
Task/Amicable-pairs/Transd/amicable-pairs.transd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#lang transd
|
||||
|
||||
MainModule : {
|
||||
_start: (lambda
|
||||
(with sum 0 d 0 f Filter( from: 1 to: 20000 apply: (lambda
|
||||
(= sum 1)
|
||||
(for i in Range(2 (to-Int (sqrt @it))) do
|
||||
(if (not (mod @it i))
|
||||
(= d (/ @it i)) (+= sum i)
|
||||
(if (neq d i) (+= sum d))))
|
||||
(ret sum)))
|
||||
(with v (to-vector f)
|
||||
(for i in v do
|
||||
(if (and (< i (size v))
|
||||
(eq (+ @idx 1) (get v (- i 1)))
|
||||
(< i (get v (- i 1))))
|
||||
(textout (+ @idx 1) ", " i "\n")
|
||||
)))))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue