Welcome to the CHICKEN Scheme pasting service
prime check via regex added by DeeEff on Fri Sep 9 22:34:52 2016
(define (prime? n)
(not (irregex-match? (irregex "^.?$|^(..+?)\\1+$")
(string-unfold (lambda (x) (>= x n))
(lambda (x) #\1)
(lambda (x) (add1 x))
0))))