private int longestCollatzStartNum(int upperBound)
	{
		BitSet b = new BitSet(upperBound+1);
		int result = 1;
		int count;
		int countLongest = 0;
		int i ;
		for(i = 2; i <= upperBound; i ++ )
			b.set(i);
		i = 2; 
		while(i <= upperBound)
		{
			if(b.get(i))
			{
				long j = i;
				count = 1;
				while(j != 1)
				{
					if(j % 2 == 0)
						j = j / 2;
					else
						j = 3*j+1;
					
					count ++ ;
					
					if(j < upperBound)
						b.clear((int)j);
				}
				if(countLongest < count)
				{
					countLongest = count;
					result = i;
				}
			}
			i++;
		}
		return result;
	}