Reference no: EM132354731
Question
There is a famous puzzle intended to demonstrate the surprising growth of exponential sequences, sometimes called the "Wheat and chessboard problem."
If a chessboard were to have wheat placed upon each square such that one grain was placed on the first square, two on the second, four on the third, and so on (doubling the number of grains on each subsequent square), how many grains of wheat would be on the chessboard at the finish?
There are 64 squares on a chess board. The function uses an accumulator loop to calculate the answer to a general version of this problem (i.e., using arbitrary sized chessboards, not just a 64 square board).
Specification: The second function written should be called 'wheatChess'.
The function should take one (1) argument: an integer representing the number of squares on the board.
The function should return one (1) integer containing the total number of wheat grains on the entire board.
Please use an accumulator for loop to receive full credit.
Note: at some point, the numbers will be too large and you will get an error. Do not worry about this. Assume we will pass in board sizes that the implementation of Python can handle.