# Necessary sample size for difference between means

Not looking for a solution, just wonder what formula to use (and why?):

Given population A and population B, where:

standard deviation(A) = standard deviation(B) = $100$

If I select equal sample size N from A and B, how big does the sample size need to be to estimate the difference in population mean to within $10$ with 99% confidence?

My attempt:

If both of the population standard deviations are known, then the formula for a confidence interval for the difference between two population means (averages) is

$\bar{x_1} - \bar{x_2} \pm z\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}$

Where $\bar{x_1} - \bar{x_2}$ is the difference in the sample means. We know the sample sizes are the same:

$n_1 = n_2 = N$

And the z value for 99% confidence level is 2.58, so:

$\bar{x_1} - \bar{x_2} \pm 2.58\sqrt{\frac{100^2 +100^2}{N}}$

Is $\pm 2.58\sqrt{\frac{100^2 +100^2}{N}}$ the margin of error? Then solving:

$10 = \pm 2.58\sqrt{\frac{100^2 +100^2}{N}}$ yields $N = 1331.28$. Am I on the right track here?