b%x|x<1=x|y<-div x 10=b*b%y+x-10*y f=sum.((10:)>>=zipWith(%)) main = print $ f [4, 12, 34, 20, 14, 6, 25, 13, 33]