What's the absolute minimum number of bookshelves to reach a level 30 enchantment?

Solution 1:

You need the maximum number of useful bookshelves (15) in order to get level 30 enchantments. The Minecraft Wiki article on Enchantment mechanics has the following table noting the max level available given a number of bookshelves:

Bookshelves  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
Min Level    1   1   1   1   1   1   1   1   1   1   2   2   2   2   2   2
Max Level    8   9  11  12  14  15  17  18  20  21  23  24  26  27  28  30

As you can see, you can't compromise on the number of bookshelves without reducing your max enchantment. It's going to take 22.5 logs, 135 sugar cane, and 45 leather. Time to start farming!