Chat with our AI personalities
The power of a quotient is the quotient of the power! (a/b)^n = (a^n) / (b^n) where a/b is the quotient and n is the power.
n to the 3rd power is n x n x n
The one line expression is: ((0 != n) && !(n & n-1)) example: int main () { for (int n = 0; n <= 1000001; ++n) { if ((0 != n) && !(n & n-1)) cout << n << " is a power of 2" << endl; } return 0; } will produce: 1 is a power of 2 2 is a power of 2 4 is a power of 2 8 is a power of 2 16 is a power of 2 32 is a power of 2 64 is a power of 2 128 is a power of 2 256 is a power of 2 512 is a power of 2 1024 is a power of 2 2048 is a power of 2 4096 is a power of 2 8192 is a power of 2 16384 is a power of 2 32768 is a power of 2 65536 is a power of 2 131072 is a power of 2 262144 is a power of 2 524288 is a power of 2
In y = x^n, n is called the exponent while x^n is called a power of n. Power really refers to a power function, which is more than simply the exponent.
n2 + n = n(n + 1)