Thursday, August 8, 2013

[Sam] 3 Solutions

Problem 1: BrainFuck

Find the sum of all multiples of 3 or 5 less than 1000: (Answer printed in unary)

The code I actually wrote:

The more cool-looking version:

Problem 2: Haskell

Find the sum of all even Fibonacci numbers less than 4000000

Problem 3: J

Find the largest prime factor of 600851475143 (First line is my initial solution, the second a better one James helped me find)

No comments:

Post a Comment