Math.pow will work for what you need to do, but before writing the code,
you should probably think about what it is you're trying to do. In the real world we have things called "business rules" that determine the expected behavior of the system.
If I have deduced the nature of your assignment correctly, this is the problem where the king/pharoah/supreme Poo-Bah tells someone/is told to fill a chessboard with grains of rice, starting with one grain in the first square and doubling the number in each square.
One of your "business rules" is, I am guessing, that you can't have a fractional grain of rice. So, you should probably have some sort of integral value that stores the number of grains of rice. You have to make sure it's big enough to hold the numbers you need to hold, so you will have to evaluate which of the integral primitives you need (byte, char, short, int, long).
Then, if the problem really does just require doubling, then maybe you can just multiply by 2 in your loop. Or, if you have to use Math.pow, then you will have to figure out how to change the double value that Math.pow returns into your integral value so you can save it. This will require the use of casting.
Since this sounds like a homework assignment, I don't want to solve the whole problem for you, but it sounds like you need to step back and look at the algorithm you're trying to use before you code it.
Susan