Saturday

Jun022012

Wednesday

May092012

## Project Euler - Problem 5

Wednesday, May 9, 2012 at 5:06PM

### What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

This was a neat question could be brute forced easily but that would be very slow. There is a table method which exploits the properties of prime numbers to find least common multiple of a set of numbers. The exact method can be found on the least common multiple wikipedia page

tagged Problem 5, Programming, Project Euler, Python in Programming

Saturday

May052012

## Project Euler - Problem 4

Saturday, May 5, 2012 at 11:00AM

### Find the largest palindrome made from the product of two 3-digit numbers.

A palindrome is a string which reads the same forwards and backwards for example 98789. The isPalinedrome(x) method checks if x is a palindrome by checking if x equals x in reverse. The n[::-1] call returns the reverse of n. The stride notation lets you filter in a interval of elements in a list. For example the call n[::2] for n = [1,2,3,4] would return [2,4]. Then a nested for loop is used to find the biggest palindrome made of the product 3 digit integers.

tagged Project Euler, Python, problem 4 in Programming