The Midlife Geek

Ramblings of a middle aged engineer, runner and open source enthusiast

Tag: Python

Number letter counts

Project Euler problem 17:

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.

If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?

Continue reading

Names scores

Project Euler again, this time Python. The problem is to sort a list of 5000 names alphabetically then give them a value. For example “COLIN” is 3 + 15 + 12 + 9 + 14 = 53 and is the 938th item – so its value is 49714 (53*938).

Continue reading

Find the sum of amicable numbers under 10000

Project Euler problem 21 is to find the sum of all amicable numbers under 10000. An amicable number is:

Let \(d(n)\) be the sum of proper divisors of \(n\) then \(d(a)=b\) and \(d(b)=a\) if \(a!=b\) then \(a\) and \(b\) are amicable numbers.

Continue reading

Project Euler, Visual Studio and playing with Python

I got Visual Studio 2017 through Microsoft’s Dreamspark promotion and thought I’d give it a try. I haven’t done a lot of development under Windows because its only on my laptop and my Linux desktop has 12 Gb RAM.
Continue reading

© 2018 The Midlife Geek

Theme by Anders NorenUp ↑