Project Euler |
Project Euler |
Apr 16 2008, 12:16 PM
Post
#1
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 2,648 Joined: Apr 2008 Member No: 639,265 |
Hey, does anyone here participate in Project Euler?
|
|
|
|
![]() |
Jul 20 2009, 07:58 AM
Post
#2
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 2,648 Joined: Apr 2008 Member No: 639,265 |
Spoiler Alert
I'm particularly proud of this piece of code that I used to solve Problem 53: CODE -- The standard combinatoric "n choose r" equation
nCr n r = (fac n) `div` ((fac r) * (fac (n - r))) -- The standard factorial equation fac n | n == 0 = 1 | otherwise = n * fac (n - 1) -- A function for counting the occurrences of values >1,000,000 in a list -- that is appropriate for foldl countMillion n x | x > 1000000 = n + 1 | otherwise = n -- Performs the calculation doIt = foldl countMillion 0 xs where xs = [nCr n r | n <- [23..100], r <- [1..n]] |
|
|
|
mipadi Project Euler Apr 16 2008, 12:16 PM
illmortal From my understanding, there's Linux/Unix user... Apr 16 2008, 12:31 PM
mipadi Uh, what? Helping what process? Apr 16 2008, 05:49 PM
illmortal QUOTE(mipadi @ Apr 16 2008, 06:49 PM) Uh,... Apr 16 2008, 05:51 PM
mipadi Project Euler's not about discovering new math... Apr 16 2008, 06:06 PM
illmortal QUOTE(mipadi @ Apr 16 2008, 07:06 PM) Pro... Apr 16 2008, 06:15 PM
mipadi I've recently started working on some of these... Mar 20 2009, 11:07 AM
Uronacid I haven't tried it, however it looks interesti... Mar 20 2009, 12:21 PM
mipadi QUOTE(Uronacid @ Mar 20 2009, 01:21 PM) I... Mar 20 2009, 12:53 PM
Uronacid QUOTE(mipadi @ Mar 20 2009, 01:53 PM) You... Mar 20 2009, 01:40 PM
mipadi Bump. I suppose Uronacid and I are the only progra... Jul 16 2009, 12:19 PM
Buttsex Looks interesting. I might try this out. Jul 16 2009, 03:11 PM![]() ![]() |