Imagine you're the person that your family and friends turn to whenever they encounter figures, because "you know about this stuff". How do you help them? What if your manager asks you to check whether some data is credible or not? What about the figures the media publish? Is there a way to tell who to trust?

Thankfully there are plenty of ways to get an idea of how credible data is, but one that's fairly easy to start with is one that was discovered in the late 19th century, and formalized in the 20th: Benford's Law.

]]>Unfortunately .NET doesn't seem to have a usable prime number generator class, and neither does the C++ Standard Library. It seems that if you want one, you need to write one.

Ruby has some quite nice prime generation facilities built in, and as of version 1.9 they're quite fast (for a scripted language!). It might be worth looking at how the Ruby designers implemented their classes later, and seeing if we can improve on them.

Let's start with the (very) basics. If we want to generate prime numbers, we need a way to check whether a number is prime or not.

]]>We'll start with a very old, but reliable method, called the "Sieve of Eratosthenes", or "Eratosthenes' Sieve".

]]>I’ll start with the basics, and then get into the more interesting stuff...

]]>