// Define the number of digits required to store the result
#define NUM_DIGITS 40
void setup() {
Serial.begin(9600);
// Define the array to store the result
int result[NUM_DIGITS] = {0};
// Set the first digit to 1
result[0] = 1;
// Calculate 2^128 iteratively
for (int i = 0; i < 128; i++) {
int carry = 0;
// Multiply each digit of the result by 2 and add the carry from the previous digit
for (int j = 0; j < NUM_DIGITS; j++) {
int product = 2 * result[j] + carry;
result[j] = product % 10;
carry = product / 10;
}
}
// Print the result
Serial.print("2^128 = ");
for (int i = NUM_DIGITS - 1; i >= 0; i--) {
Serial.print(result[i]);
}
}
void loop() {
// Nothing to do here
}