Archive for July, 2010

Checking Prime Numbers

Saturday, July 31st, 2010

Now that we have a function for generating primes, the next library function we will need is to check whether a given number is prime.

The basic method for checking whether a given number n is prime is to use trial division. This involves dividing n by the prime integers from 2 to the square root of n. If any of these divisions result in an integer the number n is not prime, else it is prime. (more…)

Generating Prime Numbers

Friday, July 30th, 2010

A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. Prime numbers appear in many of the problems in Project Euler, so I thought it would be a good idea to create some library functions to deal with these numbers. Today we are going to generate a list of prime numbers.

(more…)

Favourite Films:Lord of the Rings

Wednesday, July 28th, 2010

Film Poster
What can I say?

When this was released, I, together with millions of other fans, was waiting for the usual Hollywood hatchet job on a beloved book.  However, director Peter Jackson has done a wonderful job and stayed true to the books in most respects.  He has credited his audience with some intelligence, and assumed their attention span to be rather longer than that catered for by most directors.   

There are some minor omissions and alterations, such as no Tom Bambadil and the absence of Saruman when they return to the Shire, but these can be forgiven in the light of all that is included.

(more…)

Star Trek: The Next Generation

Tuesday, July 27th, 2010

I remember watching Star Trek:TNG when it first aired and I thoroughly enjoyed it.  I thought I would try and rediscover it by watching the complete series from the start.

I may be remembering it through rose-coloured glasses but so far I have been disappointed.  Although I have only just finished watching season 1 and have only just started on season 2, it is definitely not as good as I remember it.

(more…)