Alright, I am currently working on Euler Problem 29. The problem may be found in its full length here:

Problem 29 - Project Euler

This is the code I was confident would solve the problem:

import java.math.*;
import java.util.Arrays;
public class EulerProblem29 {
	public static void main(String[] args) {
		BigInteger[] tabell = new BigInteger[9801]; //9801 is the amount of numbers that can exist
		BigInteger hundre = new BigInteger("100");
		int i = 0;
 
		//I fill the array with the numbers.
		for (BigInteger a = BigInteger.valueOf(2);a.compareTo(hundre) <= 0;a = a.add(BigInteger.ONE)){
			for (int b = 2;b<=100;b++){
				tabell[i] = a.pow(b);
				i++;
			}
		}
		//I print out the first to check if it is correct.
		System.out.println(tabell[0]);
		//I sort the array.
		Arrays.sort(tabell);
 
		for (int j = 0;j<9801;j++){
			for (int y = 0;y<=100;y++){
				if (j + y < 9801){ //To avoid moving out of bounds.
				if (tabell[j].equals(tabell[j+y])){ //If the numbers are equal
					tabell[j+y].equals(BigInteger.ZERO); //I give one of them the value 0.
				}
 
			}
		}
	}
 
		int antall = 0;
		BigInteger zero = new BigInteger("0");
 
		for (int z = 0;z<9801;z++){
			if (!tabell[z].equals(zero));{ //If the number is not 0
				antall++; //it should count
			}
		}
 
		System.out.println(antall); //9801, for some reason.
 
	}
 
}

Now, what baffles me is the fact that the number printed at the end is 9801, the same number of elements in the array. What should be printed, according to my logic, is the number of elements minus the number of elements that are 0.

Please do not make any remarks regarding my code being inefficient or slow. The only thing I want to know is why the wrong number is printed, not how slow it is printed.