-- Slide 16 r n = rconcat n 0 rconcat inv outv = if inv == 0 then outv else rconcat (div inv 10) (outv * 10 + mod inv 10) ispal n = r n == n hpal n = if ispal n then 0 else 1 + hpal (n + r n)