In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 12. As always, any feedback is welcome. # Euler 12 # http://projecteuler.net/index.php?section=problems&id=12 # The sequence of triangle numbers is generated by adding # the natural numbers. So the 7th triangle number would be # 1 + 2 + 3 + [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 11. As always, any feedback is welcome. # Euler 11 # http://projecteuler.net/index.php?section=problems&id=11 # What is the greatest product # of four adjacent numbers in any direction (up, down, left, # right, or diagonally) in the 20 x 20 grid? import [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 51. I know I started back up with Python this week, but I have three more Ruby solutions in the hopper and I wanted to share. For the record, Project Euler 51 was the second hardest Euler problem for me [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 10. As always, any feedback is welcome. # Euler 10 # http://projecteuler.net/index.php?section=problems&id=10 # The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. # Find the sum of all the primes below two [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 9. As always, any feedback is welcome. # Euler 9 # http://projecteuler.net/index.php?section=problems&id=9 # A Pythagorean triplet is a set of three natural numbers, # a b c, for which, # a2 + b2 = c2 # For example, 32 + [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 8. As always, any feedback is welcome. # Euler 8 # http://projecteuler.net/index.php?section=problems&id=8 # Find the greatest product of five consecutive digits # in the following 1000-digit number import time start = time.time() number = ‘\ 73167176531330624919225119674426574742355349194934\ 96983520312774506326239578318016984801869478851843\ 85861560789112949495459501737958331952853208805511\ 12540698747158523863050715693290963295227443043557\ 66896648950445244523161731856403098711121722383113\ [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 7. As always, any feedback is welcome. # Euler 7 # http://projecteuler.net/index.php?section=problems&id=7 # By listing the first six prime numbers: 2, 3, 5, 7, # 11, and 13, we can see that the 6th prime is 13. What # is [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 6. As always, any feedback is welcome. # Euler 6 # http://projecteuler.net/index.php?section=problems&id=6 # Find the difference between the sum of the squares of # the first one hundred natural numbers and the square # of the sum. import time start [...]