# Possible permutations, how to work out the maths

I am interested in understanding how to calculate possible permutations. For example for a 24bit MAC address (made up) ad:ba:32:d5:f0:dd. I believe the highest possible value per octet would be FF. So the highest possible value for the last 3 octets would be FF:FF:FF, so would that be 16 to power of 16? or 16 x 16? As you may have guessed my maths is rather lacking so I would like to understand how this would work.

Possible Values Up To F

Let me call every $4$ bit a 'key'. Each key has $16$ possibilities. Hence, for a $4n$-bit MAC address, there would be $n$ keys for you to assign a value.
Thus you have $$\underbrace{16\times16\times\ldots\times16}_{n \text{ 16's}}=16^n$$ permutations in total.
As each octet has $2$ keys, each octet has a total of $$16\times16$$ possibilities. An address with $m$ octets i.e. $2m$ keys, will thus have $$(16\times16)^m=16^{2n}$$ possibilities