Wikipedia: Zeno's Dichotomy Paradox
An infinite number of mathematicians walk into a bar. The first one orders a beer. The second one orders half a beer. The third one orders a fourth of a beer. The bartender stops them, pours two beers and says, "You're all a bunch of idiots."
Print the following series for as long as the program runs, with the denominator of each item being multiplied by two each time:
1 + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...
As n
approaches infinity, the sum of this sequence approaches 2
.
Rules
No, you may not print 2
.
You may not print 1/1
as the first item.
You may remove spaces 1+1/2+...
or add spaces 1 + 1 / 2 + ...
as you need.
You may use newlines instead of spaces as a delimiter due to popular demand.
You may append a .
plus a constant number of 0
s to the denominator if need be.
"Infinitely" means no unnecessary delays, and for as long as possible limited by the current (variable) system's specs, but not limited by your current language.
Standard loopholes apply.
This is code-golf, so shortest answer in bytes wins.
+1/
s would just form a diagonal line. However, the lengths of the denominators is changing linearly (up to rounding): the number of digits of2^n
is aboutn log(2)/log(10)
. That linear change translates into a linear change in the relative position of each+1/
with respect to the preceding one, which is the same as a quadratic change in the absolute position. \$\endgroup\$