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:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1.bf

The more cool-looking version:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1Unreadable.bf

Problem 2: Haskell

Find the sum of all even Fibonacci numbers less than 4000000

https://dl.dropboxusercontent.com/u/34972177/PELC/e2.hs

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)

https://dl.dropboxusercontent.com/u/34972177/PELC/e3.jis

No comments:

Post a Comment