## Project Euler Problem 207

import Data.List import Data.Ratio import Data.Bits recur::Integer ->Integer recur n | (%) ( truncate.logBase 2.fromIntegral $ n ) ( n - 1 ) < (%) 1 12345 = n | otherwise = recur ( n + 1 ) solve::Integer solve = x^2 - x where x = recur 2 main = print solve

Project Euler Problem 207 is really nice and cryptic problem. Most of time was spend to understand the problem statement. We can write the given equation . Its given that is positive integer so K will be of form .When K will be power of 2 [ t will be positive integer ] then we have perfect partition. In short we have to find the .

Advertisements

No comments yet.

## Leave a Reply