promeni_zapis x b1 b2 = if b1/=10 then u_osnovu_b2 (u_dekadnu x b1 0 1 ) b2 0 1 else u_osnovu_b2 x b2 0 1

u_dekadnu x b1 = if x==0 then 0 else u_dekadnu (x `div` 10) b1 * b1 + (mod x 10) 
u_dekadnu2 x b1 sum st = if x==0 then sum else u_dekadnu2 (x `div` 10) b1 (sum+(mod x 10)*st) (st*b1)

u_osnovu_b2 x b2 sum st = if x==0 then sum else u_osnovu_b2 (x `div` b2) b2 (sum+(mod x b2)*st) (st*10)
