Prime Numbers array

If you’d like to play around with prime numbers, like I did in my Prime Patterns post, then you’ll need an array of primes. Here are the two that I created. One has the first 10,000 prime numbers and the other has the first 64,000 prime numbers – it’s actually just short of 64,000. Here’s the gist of the class:

package VO {
	public class Primes10000 {
		public static var primes : Vector. = new [
			2,3,5,7,11,13,17,19,23,29,
			31,37,41,43,47,53,59,61,67,71,

Obviously for testing purposes you can use the Primes10000 so that you can rapidly compile and loop through the array. Then if you need to go big you can easily switch to Primes64000.

NOTE: Do NOT try and open the Primes64000 class in Eclipse. At best it will slow everything down. At worst it will crash Eclipse. There’s really no need to open either of these classes but if you do want to then I’d suggest using a basic text editor. ( Consider yourself warned. )