public static void main ( String [] args ) {
	BigInteger a = new BigInteger("2");
	BigInteger step = new BigInteger("1");
	BigInteger limit = new BigInteger("101");	
	// use TreeSet to avoid the duplication of numbers
	TreeSet<String> set = new TreeSet<String>();
	int b = 2;

	while ( a.compareTo(limit) == -1 ) {
	    b = 2;
	    while ( b<=100 ) {
		set.add(a.pow(b).toString());
		b++;
	    }
	    a = a.add(step);
	}

	System.out.println("size="+set.size());
    }