QB64 Phoenix Edition
Understanding powers and indices (simply) - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: Understanding powers and indices (simply) (/showthread.php?tid=1015)

Pages: 1 2


RE: Understanding powers and indices (simply) - PhilOfPerth - 10-29-2022

@bplus Much more elegant than my effort!
But actually, I think there's one grain less than this. e.g. for three squares, square 1 has 1 grain, square 2 has 2 and square three has 4,  total 7, not 8. Not that the king would notice, but he's being gypped!


RE: Understanding powers and indices (simply) - bplus - 10-29-2022

OK here is what Internet said about Grains of sand:
   

But what if you got the rice from each square when doubling amount for each square =
1 or 2 ^ 1 - 1
1 + 2 = 3 or 2 ^ 2 - 1
1 + 2 + 4 = 7 or 2 ^ 3 - 1
1 + 2 + 4 + 8 = 15 or 2 ^ 4 - 1
...
1 + 2 + 4 + 8 + .... + 9,223,372,036,854,775,808 = 2 ^ 64 - 1 = 18,446,744,073,709,551,615


RE: Understanding powers and indices (simply) - Pete - 10-29-2022

And where could we dump all that rice? Oh, I know, the Grain Canyon.

Pete

A little bit of levity only hurts when you land.


RE: Understanding powers and indices (simply) - PhilOfPerth - 10-29-2022

(10-29-2022, 04:14 AM)Pete Wrote: And where could we dump all that rice? Oh, I know, the Grain Canyon.

Pete

A little bit of levity only hurts when you land.
Did you mean gravy-tea?


RE: Understanding powers and indices (simply) - Pete - 10-29-2022

As in what you might serve at a Jap-party?

Pete

I lost on Jap-party, baby, ooh, ooh, ooh, ooh...