I think you may be trying to find the sample size necessary to
achieve a certain margin of error in a confidence interval of
the type
$$\text{Parameter Estimate} \pm \text{Margin of Error}.$$
(1) Suppose you are going to have $n$ observations from a
normal population with unknown population mean $\mu$ and known
population standard deviation $\sigma_0.$ Then a 95% confidence
interval (CI) is
$$\bar X \pm 1.96 \sigma_0/\sqrt{n},$$
where $\bar X$ is the sample mean and $1.96 \sigma_0/\sqrt{n}$ is
the margin of error. If you want to have a specific margin of
error $E$ in your CI, then you set $E = 1.96 \sigma_0/\sqrt{n}.$
Everything but $n$ is known. Solve for $n$ and you know how
many observations to take.
(2) Suppose you are doing a poll to see how popular Caidate X is
in the weeks before an election. Then you want to estimate
the population proportion $p$ in favor on Candidate X. You
will estimate this is $\hat p = X/n$, where $X$ is the number
of interviewed people currently favoring Candidate X, and $n$
is the number of people interviewed. Then a 95% CI for $p$ takes
the form
$$\hat p \pm 1.96\sqrt{\hat p (1 - \hat p)/n}.$$
Here the margin of error is $1.96 \sqrt{p(1-p)/n}$, but you don't
know $p$. So, for planning purposes you might use $p = 1/2$
and set your desired margin of error
$$E = 1.96 \sqrt{p(1-p)/n} = 1.96\sqrt{.5(1-.5)/n} \approx 1/\sqrt{n}.$$ Then you can solve for $n$ and you will know
how many subjects to interview.
Undoubtedly, you will get different answers for $n$ depending on whether you use the formula in (1) or the formula in (2). And there
are other kinds of formulas for other kinds of problems.
So before you try to find $n$ for a particular experiment or
survey, you have to make sure you are thinking about the
correct kind of statistical analysis and have the correct
formula for $E$ in order to get a meaningful value of $n$.
Best Answer
At the $95\%$ confidence level, the confidence interval is given by $\mu\pm1.96\sigma/\sqrt n$ where $\mu$ is the mean, $\sigma$ is the standard deviation and $n$ is the sample size. From the question, we want $1.96\sigma/\sqrt n=0.5$ and since $\sigma=5$, the sample size required is $n=(1.96\cdot5/0.5)^2=384.16$, or $385$ after rounding up.