I have run into a challenge on Codecademy.com that has me absolutely bewildered. I'm sure I'm just overlooking an obvious solution, but I've been scouring tables of trigonometric and logarithmic identities for days and I still don't know where to start. The original task is here, and it's simply called "Broken Calculator".
I've found other "Broken Calculator" problems online, but this one is the first I've seen that makes use of trig and log functions. Specifically, the only functions available are $e^x$, $ln$, $x^2$, √, $sin$, $cos$, $arcsin$, and $arccos$. The calculator defaults to 0, so you can get the number 1 by hitting $e^x$, and you can get 2 by hitting $e^x$ again, then $x^2 $, then $ln$. That's all simple.
Now, I can get any power of 2 by repeating the steps above, and similarly, given any number to start from, I can multiply or divide by a power of 2. That's easy.
The next challenge is to get 3, which I found using a 1, 2, √3 triangle and the appropriate trig functions:
$e^x$, $e^x$, √, $ln$, $arcsin$, $cos$, $e^x$, $x^2$, $ln$, $x^2$ -> 3
Again, I'm sure you find this trivial, but how would I use the same functions to get the number 11, or really any odd number for that matter other than 3?
The first two comments point out that the factorial operator is available for the first task where we need to find 3. However, in the very next task, we lose the factorial operator in exchange for the trig functions. I solved it using the steps above, but am stuck on the task to find 11.