Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Haskell by Ash ( 16 years ago )
mult x y = sum (map snd b) where
  v x = div x 2 
  g y = y*2
  m = takeWhile (>=1) (iterate v x)
  n = length m
  k = take n (iterate g y)
  a = zip m k 
  b = [(o,p)| (o,p)<-a, odd o]

 

Revise this Paste

Your Name: Code Language: