In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 20. As always, any feedback is welcome. # Euler 20 # http://projecteuler.net/index.php?section=problems&id=20 # n! means n x (n – 1) x … x 3 x 2 x 1 # Find the sum of digits in 100! import time start = [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 19. As always, any feedback is welcome. # Euler 19 # http://projecteuler.net/index.php?section=problems&id=19 # You are given the following information, but you may # prefer to do some research for yourself. # # – 1 Jan 1900 was a Monday. # [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 18. As always, any feedback is welcome. # Euler 18 # http://projecteuler.net/index.php?section=problems&id=18 # By starting at the top of the triangle below and moving # to adjacent numbers on the row below, the maximum total # from top to bottom [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 17. As always, any feedback is welcome. # Euler 17 # http://projecteuler.net/index.php?section=problems&id=17 # If the numbers 1 to 5 are written out in words: # one, two, three, four, five, then there are # 3 + 3 + 5 + [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 16. As always, any feedback is welcome. # Euler 16 # http://projecteuler.net/index.php?section=problems&id=16 # 2^15 = 32768 and the sum of its digits is # 3 + 2 + 7 + 6 + 8 = 26. # What is the sum [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 15. As always, any feedback is welcome. # Euler 15 # http://projecteuler.net/index.php?section=problems&id=15 # Starting in the top left corner of a 2×2 grid, there # are 6 routes (without backtracking) to the bottom right # corner. How many routes are [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 14. As always, any feedback is welcome. # Euler 14 # http://projecteuler.net/index.php?section=problems&id=14 # The following iterative sequence is defined for the set # of positive integers: # n -> n/2 (n is even) # n -> 3n + 1 (n [...]
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 13. As always, any feedback is welcome. # Euler 13 # http://projecteuler.net/index.php?section=problems&id=13 # Work out the first ten digits of the sum of the # following one-hundred 50-digit numbers. import time start = time.time() number_string = ‘\ 37107287533902102798797998220837590246510135740250\ 46376937677490009712648124896970078050417018260538\ 74324986199524741059474233309513058123726617309629\ [...]