In code, you can do this using the bitshift operator as well instead of using pow or something, courtesy of binary:
n = 5 << (level - 1);
Watch out for overflow though. Of course, if later on you want to have partial levels, e.g. level = 2.5 somewhere between level 2 and level 3, then just using pow is the better solution, since you're using floats anyway.