//Written by Lachlan Birdsey.  2010. lollbirdsey@gmail.com
//Produces a list of prime numbers up until the x-th prime number

import java.util.*;
public class PrimeNumber
{
	public static void main(String[] args)
	{
		double i = 0;
		double j = 1; 
		double p = 0; 
		double n = 1; 
		double q = 0; 
		double x = 0;
		double z = 0;
		double f = 0;
		
		Scanner input = new Scanner(System.in);
		
		System.out.println("Please input which prime number you would like to see: ");
		i = input.nextInt();
		z = 0;
		
		System.out.println("Here are the first " + i + " prime numbers");
		while (j <= i)
		{
			while (n <= z)
			{
				if (z%n == 0)
				{
					x++;
				}
				n++;
				
			}
			n = 1;
			f = z;
			
			if (x < 3 && z != 0 && z != 1)
			{
			j++;
			p = f;
			System.out.println(p +" ");
			}
			x = 0;
			z++;
		}
	}
}
				
		