Ok, the traditional equation is 2^n-2. The reason is the not all routers will support the use of the first and last subnet IDs. There is an explanation if you are interested.
I have a high level overview if you are interested:
http://www.itgeared.com/articles/1347-cidr-and-subnetting-tutorial/
If they are teaching 2^n these days, that's fine. For three subnets, you would use two bits for four subnets.
I also have an online subnet calculator use can use to apply different masks and see the results.
http://www.itgeared.com/tools/ip-subnet-calculator/
The subnet mask you can use for three subnets using your formula is 255.255.255.192. We moved to the right 2 bits.
JorgeM
Industrious Poster
4,007 posts since Dec 2011
Reputation Points: 294
Solved Threads: 544
Skill Endorsements: 115