Could you generate any positive number given only a few specific operators and operands?

You can get arbitrarily close to any number in $\Bbb R^+$ You showed you can get any positive integer. Now to get sort of close to $\pi$ you can form $1385$ and take the log, getting about $3.14145$. You can get closer by forming the closest integer to $10^{10^\pi}$ and taking the log twice. Keep going with the tower until you get as close as you want. The negative reals work the same. If you want to approach $x$, which is less than $0$, let $k$ be large enough so that $x+2k \gt 0$, approximate that, and subtract off $k\ 2$s.

You can do the same thing by forming the closest integer to $\pi^2$, which is $10$, and taking the square root, getting $3.162$. Then form the closest integer to $\pi^4$, which is $97$ and take two square roots, getting $3.138$. Keep going through $\pi^{2^n}$ and $n$ square roots.

I don't think you can get all rationals exactly because you don't have enough tools to get good denominators.


Yes: in fact just using $+7$ and $-2$ is enough:

If you are aiming for $k$ then starting from $0$ add $7$ a total of $k$ times and then subtract $2$ a total of $3k$ times. You will end up at $0+7k-6k=k$


You can get all rationals with a power of two times a power of 5 in the denominator (that is, all terminating decimals).
To get $a/(2^b * 5^c)$:
Generate $10^a$, hit sqrt $b$ times, hit log10, then hit /5 $c$ times.

Tags:

Puzzle