Euler Project: Problem 10 – Python

This weeks covering of the Euler Project: Problem 10 Asks us to simply: Find the sum of all primes below 2 million. Were going to take almost the entire solution for this from our solution to problem 7, where we start out with a generator function to produce our prime numbers, and then use a [...]

Euler Project: Problem 9 – Python

The Euler Project has been a fun way to examine how well we know our programming language of choice. Today we’re covering problem 9 which reads as follows: A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 [...]

Euler Project: Problem 7 – Python

Welcome to this installment of the Euler Project in python. Today we cover problem 7 which asks this question: 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 the 10,001st prime number? For this one we’ll create a prime [...]

Euler Project: Problem 6 – Python

Today’s coverage of the Euler Project looks at problem 6. This is a simple and sweet solution, meaning a short post, meaning less of that magical insight that we strive so hard to provide. Problem 6 of Euler Project asks the following: The sum of the squares of the first ten natural numbers is: 12 [...]

Euler Project: Problem 5 – Python

Welcome to our discussion of Problem 5 of the Euler project. The Euler Project has been an interesting way to explore our understandings of the coding languages we thought we knew so well. Problem 5 inquires the following: 2520 is the smallest number that can be divided by each of the numbers from 1 to [...]

Euler Project: Problem 4 – Python

Today we are covering the Euler Project problem 4. See it in its full glory here. While you’re there sign up and get started! Problem four poses this question: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find [...]

Euler Project: Problem 3 – Python

Today we are covering Problem 3 of the Euler Project found here.The question goes as such: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? This is an interesting one, I started with the sieve of Eratosthenes, and saved it as it works [...]

Euler Project: Problem 2 – Python

We have covered generator functions already, and I’ve actually used a variation of this problem as one of the examples doing so (less the only even numbers part). Anyways our second installment covering Problem 2 of the Euler Project series reads as follows: Each new term in the Fibonacci sequence is generated by adding the [...]

Euler Project: Problem 1 – Python

We’ll be starting a series covering the Euler Project found here today. Stay tuned for more updates as the beginning ones are quite simple, and of little real interest. Euler Project: Problem 1 reads as follows: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, [...]

Check For Truncation In MySQL Table Using Python

I was writing a truncation checking script for specifically varchar column types the other day, thought I would share it, open up the floor for discussion on better methods for doing so, specifically regarding the MySQL portion devoted to determining longest length of current column. Its based on this little tidbit, as it has been [...]