byte mem[1024 * 1024]; void insertNumber(num) { // Find the byte to set the bit in. index = num / 8; // Set the bit in the byte for the number mem[index] = mem[index] | (1 << (num % 8)); }