fork download
  1. p n m 2=compare n m==LT
  2. p n m d=if compare n m==LT then False else if mod n m==0then p n(m+1)(d+1)else p n(m+1)d
  3. d z y x=if z==x then return()else if p y 1 0then do
  4. d(z+1)(y+1)x else d z(y+1)x
  5. main=do
  6. d 0 1(read n)
Success #stdin #stdout 0s 4784KB
stdin
11
stdout
2
3
5
7
11
13
17
19
23
29
31