Sound and Fury

Signifying nothing

I have a new-found respect for programmers

leave a comment »

Respect might be a bit of a strong word for it…

Basically, I spent far too long today trying to get a Python program to check whether a number was divisible by any number on a list of numbers and then to use this to add to a list of primes. I could do it, but it was very inelegant and I couldn’t find a neat way to get the program to skip to the next number if it found a divisor. My program now works, but it is pretty clunky and not very neat. I am sure there is a much better way to do it.

Still, I am getting the hang of writing Python, which was the point of the exercise. And now onwards to bigger and better things… Having the list print to a file, cutting out unnecessary computational steps (ie, stopping when it finds no divisors up to half the size of the number in question…) and so on.

Or I could go back to my original project which was to create an array of numbers and their prime factors.

Well, when I first thought of learning Python I wanted to make a program that computed digits of pi. But that seemed to involve too much maths and not really that much programming proper. I might do it one day, still…

Advertisements

Written by Seamus

August 7, 2007 at 12:13 am

Posted in maths, python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: