If $x$ is the width of the strip, your initial setup of $(20-2x)(30-2x)=336$ is fine.
Correction: Like you, I didn’t read closely enough. It’s the grass, not the garden, that is to have an area of $336$ square metres. If you make a sketch, you’ll see that the area of the strip of width $x$ is $$2x(30-2x)+2x(20-2x)+4x^2= 2x(50-4x)+4x^2=100x-4x^2\;,$$ and the correct equation is therefore $100x-4x^2=336$, or $4x^2-100x+336=0$.
Everything in sight is a multiple of $4$, so you can save yourself some work by dividing through by $4$ to get $x^2-25x+84=0$, exactly as you did, albeit to the wrong equation. If you don’t see the factorization $(x-21)(x-4)$, just use the quadratic formula:
$$x=\frac{25\pm\sqrt{25^2-4\cdot84}}2=\frac{25\pm17}2=21\text{ or }4\;.$$
Now it’s clear that the strip can’t be $21$ m wide, so we must have $x=4$, giving the centre plot dimensions of $(20-2\cdot4)\times(30-2\cdot4)=12\times 22$, as stated.
I'm going to re-orient things, and shift a phase, for reasons that I hope become clear.
A curve parameterized by
$$(x,y)=\left(f(t),\frac{\cos t}{f(t)}\right) \tag{1}$$
meets, and is tangent to, the hyperbola(s) $xy=\pm 1$ when $t$ is an integer multiple of $\pi$. Let $P_k = (x_k,y_k)$ be the point of tangency corresponding to $t = k\pi$.
(Note that the $P_k$ are not the local maxima and minima of the graph, since the tangent lines at those points are not horizontal.)
We want the horizontal offsets between every-other point of tangency to be a power of $\phi$; specifically, we want
$$x_{k+1}-x_{k-1} = \phi^k \tag{2}$$
I suspect that OP intends the graph to bounce between the branches of the hyperbolas without crossing the $y$-axis (OP's $x$-axis). Moreover, it seems appropriate —but apparently, it is not; see "Update" below— for the graph to approach the $y$-axis, so that the $x$-coordinate of $P_0$ is the accumulated horizontal offsets in the sum
$$x_0 = \phi^{-1}+\phi^{-3}+\phi^{-5} + \cdots = \frac{\phi^{-1}}{1-\phi^{-2}}=\frac{\phi}{\phi^2-1}=\frac{\phi}{(\phi+1)-1} = 1 = \phi^0 \tag{3}$$
(where we have exploited the golden ratio property $\phi^2 - \phi - 1 = 0$). Likewise,
$$x_{-1} = \phi^{-2}+\phi^{-4}+\phi^{-6}+\cdots = \frac{\phi^{-2}}{1-\phi^{-2}}=\phi^{-1}\qquad\text{and}\qquad x_1 = 1 + x_{-1} = \phi^1 \tag{4}$$
Interesting. We have three instances where the subscript on $x$ matches the power on $\phi$. Well, if $x_{k-1}=\phi^{k-1}$, relation $(2)$ allows us to write
$$x_{k+1} =x_{k-1}+\phi^k = \phi^{k-1}+\phi^{k} = \phi^{k-1}(1+\phi) = \phi^{k-1}\phi^2=\phi^{k+1} \tag{5}$$
so that, by induction, all subscripts on $x$ match the powers on $\phi$. We can extend this notion from integer $k$ to all reals by taking
$$f(k\pi) =x_k= \phi^k \quad\to\quad f(t) = \phi^{t/\pi}\quad\to\quad (x,y) = \left(\phi^{t/\pi},\phi^{-t/\pi}\cos t\right) \tag{$\star$}$$
This certainly seems to give the desired plot:
Update.
In comments below and in a revised question, OP updated the requirements so that (in my re-oriented context) the curve must pass through $(1,0)$; for greater generality, we'll make this $(\beta,0)$. Moreover, the revised question asks that the offsets between tangent points be scaled powers of $\phi$. These changes are not difficult to accommodate. Let's return to the above analysis at $(2)$, adjusting it to include $\alpha$:
$$x_{k+1}-x_{k-1} = \alpha\phi^k \tag{2'}$$
Observing that
$$\phi^{k+1}-\phi^{k-1} = \phi^k \left( \phi - \frac{1}{\phi}\right) = \phi^k (\phi-(\phi-1)) = \phi^k \tag{3'}$$
it's reasonable to suspect that $f$ has the form
$$f(t) = \alpha\phi^{t/\pi}+c \tag{4'}$$
for some constant $c$ that gets lost in the difference in $(2')$.
Previously, getting the curve to approach the $y$-axis amounted to having $c=0$ (with $\alpha=1$). Now, to pass through $(\beta,0)$, all we need to do is force $f(t)$ to be $\beta$ when $\cos(t)$ is $0$; specifically, OP wants the curve to meet $(\beta,0)$ between my $P_1$ and $P_{-1}$, so we take $t=-\pi/2$. Solving gives
$$\beta = f\left(-\frac{\pi}{2}\right) = \alpha\phi^{-\pi/2/\pi}+c \qquad\to\qquad c = \beta-\frac{\alpha}{\sqrt{\phi}} \tag{5'}$$
whence
$$f(t) = \alpha\phi^{t/\pi} - \frac{\alpha}{\sqrt{\phi}} + \beta \tag{$\star$'}$$
For $\alpha=\beta=1$, the plot is as follows:
The substitution $t\to t-\pi/2$ shifts the phase of things so that $(\beta,0)$ occurs at $t=0$. Moreover, it trades $\cos t$ for $\sin t$ in the parameterization, so that, calling the shifted function $f_0$, we have
$$f_0(t) = \alpha\phi^{(t-\pi/2)/\pi} + \beta - \frac{\alpha}{\sqrt{\phi}} = \frac{\alpha}{\sqrt{\phi}}\left(\phi^{t/\pi}-1\right) + \beta \quad\to\quad (x,y) = \left(f_0(t),\frac{\sin t}{f_0(t)}\right)$$
Best Answer
This is not a weird question at all, but I don't think this is the best forum for a lesson on logarithms. You'll find lots of stuff on the Web if you Google "logarithm." I suggest you look at some of the lessons, and come back here if you have questions. In the meantime, I'll explain how to answer the question.
What you want is the base-$2$ logarithm. For example $$\log_2 7=x$$ means the same thing as $$2^x=7.$$ Now, to compute $\log_2{7}$ we can use WolframAlpha and find $$\log_2{7}\approx2.8$$ This tells us that the $n$ we seek is either $2$ or $3$. While it's easy to guess that the answer is $3$ in this case, until you know more about logarithms, I suggest you just compute bot $2^2$ and $2^3$ and see which is closer. It's not always true that you can just take the integer closest to the logarithm.
Hope this helps.
EDIT
Let's say that $t=\left\lfloor\log_2 n\right\rfloor$, that is, $t$ is the greatest integer less than or equal to $\log_2 n$, so we know $$2^t\leq n< 2^{t+1}$$
We want to set $m=t$ if $n\leq \frac32\cdot2^t$ that is, if $$\log_2 n<\log_2\frac32+t=t+.584963...$$
so you compute $\log_2 n$, and round down if the integer part is less than $.584963$, otherwise, round up.
If $n$ happens to be very close to $3\cdot2^m$ for some integer $m$, you may still have to compute $2^m$ and $2^{m+1}$ to be sure which to take, because of roundoff error in computing the logarithm.