public long nthPrime(long n){
		
		if (n < 1)
			return -1;
		else if (n==1)
			return 2;
		else if (n==2)
			return 3;
		
		long primeCount = 2;
		long nthPrime = 3;
		boolean primeFound;
		while (primeCount < n){
			primeFound = false;
			while(!primeFound){
				nthPrime = nthPrime+2;
				ProblemThree primeFinder = new ProblemThree();
				if (primeFinder.isPrime(nthPrime)){
					primeFound = true;
					primeCount = primeCount +1;
				}
			}
		}
		
		return nthPrime;
	}