Artificial intelligent assistant

How many flowers do we need? There are seven temples. We want to give same number of flowers to the each temple. Before giving flowers to any temple, we wash them. Whenever we wash our flowers, the amount of flowers we have is doubled. How many flowers do we need at first and at each temple, so that we have given away all of our flowers after giving to the seventh temple ?

Start with $x_0$ units of flour, where one unit is required for each idol. After washing if you have $2x_0$ units. You use $1$ unit in the first temple, so you have $x_1=2x_0-1=2(x_0-1)+1$ units when you go to the second temple. After washing this you have $2x_1=2^2(x_0-1)+2$ units; you use $1$ unit in the second temple and take $x_2=2x_1-1=2^2(x_0-1)+1$ units to the third temple. Wash it to get $2^3(x_0-1)+2$ units, leave $1$ unit in the third temple, and take $x_3=2x_2-1=2^3(x_0-1)+1$ units to the fourth temple.

It’s not hard to see (and to prove by induction on $k$, if you wish) that $x_k=2^k(x_0-1)+1$ for each $k\ge 0$, where $x_k$ is the amount of flour left after the $k$-th temple. We want to choose $x_0$ so that no flour is left after the seventh temple has been visited. This means choosing $x_0$ so that $x_7=0$, i.e., so that $2^7(x_0-1)+1=0$; this is an easy equation to solve.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 3ac2b091c697a0e2401a1c3b946c15c2