Wolfram input: Limit[\(40)Sum[\(40)Sqrt[Power[x,2]+Power[\(40)Sqrt[1+\(40)1-nx\(41)\(40)-1+nx\(41)]-Sqrt[1+\(40)1-nx+x\(41)\(40)-1+nx-x\(41)]\(41),2]]\(41),{n,1,Divide[2,x]}],x->0])
Natural Language Input: Limit[(Sum[(Sqrt[x^2+(Sqrt[1+(1-nx)(-1+nx)]-Sqrt[1+(1-nx+x)(-1+nx-x)])^2]),{n,1,2/x}],x->0])
$$
\lim_{x\to 0} \left\{\sum_{n=0}^{2 \over x} \left[\sqrt{x^2+\left[\sqrt{1+(1-nx)(-1+nx)}-\sqrt{1+(1-nx+x)(-1+nx-x)}\right]^2}\right]\right\}
$$
I am using it to find the length of a curved function. Measuring smaller and smaller lengths, thus the $\lim_{x\to 0}$, the same method as integrals, but with length not area. Since Desmos (which I'd been using) didn't allow for limits, I used Wolfram Alpha, but it didn't work. This is a simplified version of
$$
\sum_{n=1}^{c}\sqrt{\left[\mathrm{a_{1}}(n+1)-\mathrm{a_{1}}(n)\right]^{2}+\left[\mathrm{f}(\mathrm{a_{1}}(n+1))-\mathrm{f}(\mathrm{a_{1}}(n))\right]^{2}}
$$
where
$c$ is the number of lines to measure the length of using the expression: $\frac{\left|x_{1}-x_{2}\right|}{x_{0}}$.
$x_{1}$ and $x_{2}$ represent the domain of the area $x_{1}\le x \le x_{2}$ to measure (for my purposes they are $-1$ and $1$ respectively).
$x_{0}$ is the distance on the $x$ axis between every point. With the limit, I replace it with $x$ in the limit..
Function $\mathrm{a_{1}}$ represents a sequence $[x_{1},x_{1}+x_{0},\dots,x_{2}$], and $a_{1}(x)=x+(x-1)x_{0} \quad \{x\le x_{2}\}$
the function $\mathrm{f}$ is the equation for the function, in this case $\sqrt{1-\left(x-x_{c}\right)^{2}}$, $\left\{x_{1}\le x\le x_{2}\right\}$, the circle equation.
$x_{c}$ is the $x$ coordinate of the circle, in this case $0$.
This is just the the sum of the distance between every point using the Pythagorean theorem.
It might help with the code if instead of limiting as $x \to 0$ you write it as a limit for $N \to \infty$ with $N = 1/x$.
Also you have set up the arc length Riemann sum correctly.
We can rewrite your sum (replacing $x$ with $1/N$ and reversing the order of summation) as $$\lim_{N \to \infty}\sum_{n = 0}^{2N} \frac{1}{N}\sqrt{1 + \left(N\left( \sqrt{1- \left(\frac{n+1}{N} \right)^2} - \sqrt{1-\left(\frac{n}{N} \right)^2}\right)\right)^2}$$
Intuitively, $\frac{1}{N} \approx dx$. Let $f(x) = \sqrt{1 - x^2}$. Then $$ N\left( \sqrt{1- \left(\frac{n+1}{N} \right)^2} - \sqrt{1-\left(\frac{n}{N} \right)^2}\right) \approx \frac{f(x + dx) - f(x)}{dx} \approx f’(x)$$
The series is a Riemann sum for this arc length integral:
$$\int_0^2 \sqrt{1 + f’(x)^2}dx = \pi$$.
The half circumference of a circle with radius 1.