Today, a short post with a Python recursive function that finds the nth Fibonacci number.
Setting IPython on Mac OS X, Mountain Lion
This post describes how to install IPython on a Mac OS X, Mountain Lion. Step by step, it explains how to install Python, Homebrew, Virtualenv, IPython, IPython Notebook and some useful libraries like Matplotlib.
Python scripts for prime numbers and divisors
Very recently I been interested in solving the problems proposed by Project Euler. Currently I just solved about 20 problems, but I run into some nice algorithms for finding prime numbers and divisors that I would like to share.
This first snippet defines a function that returns a list of the prime numbers up to a given integer. It uses the Sieve of Atkin, which is a modern algorithm that optimizes the Sieve of Eratosthenes.