Yak Shaving

just me

Problem 3

with one comment

#!/usr/bin/python

def prime(n, start):
    factors = []
    while (n % start != 0):
        start = start + 1

    factors.append(start)

    if n > start:
        factors.extend(prime(n/start, start))

    return factors

print max(prime(600851475143, 71))

Written by channam

November 6th, 2008 at 12:48 am

Posted in code, project euler, python

Tagged with ,

One Response to 'Problem 3'

Subscribe to comments with RSS or TrackBack to 'Problem 3'.

  1. [...] in the light of how short some of my colleagues code is (see Chris’s python solution on his blog) although this erlang effort still performs well for numbers 3 orders of magnitude [...]

Leave a Reply