fork download
  1. #lang racket
  2.  
  3. (for ([n (in-port)])
  4. (let ([root (sqrt n)])
  5. (displayln (if (exact? root)
  6. (* root 2)
  7. (for/first ([div (range (exact-floor root) 0 -1)]
  8. #:when (= 0 (remainder n div)))
  9. (+ div (quotient n div)))))))
Success #stdin #stdout 0.4s 59364KB
stdin
7
43
4568
838
3491
2544788
stdout
Standard output is empty