It is interesting to note that any angle between 45° to 90° satisfying $1\over4$ < $p \over q$ <$1\over2$ where $ p \over q$ is of form $p = 2^n $ and $q$ is an odd number satisfying $2^{n+1} <q <2^{n+2}$ can be represented as cyclic infinite nested square roots of 2 (Hereafter referred as $cin\sqrt2$) refer here for an example of interesting cyclic infinite nested radical
Let us consider certain cosine angles with odd numbers starting from 5 and its exponents and see the number of $'+'$ and $'-'$ signs in single cycle
$2\cos(\frac{2\pi}{5})=\sqrt{2+2\cos(\frac{4\pi}{5}})=\sqrt{2-2\cos(\frac{\pi}{5}})=\sqrt{2-\sqrt{2+2\cos(\frac{2\pi}{5}}})$. We can observe expansion goes infinite and results in cyclic infinite nested square roots of 2 for $2\cos(\frac{2\pi}{5})$ or $2\cos72^\circ$
$2\cos\frac{2\pi}{5} = cin\sqrt2[1-1+]$ single cycle contains $1 -$ sign and $1 +$ sign and is simple representation of $\sqrt{2-\sqrt{2+...}}$
$2\cos(\frac{8\pi}{25}) = \sqrt{2+2\cos(\frac{16\pi}{25}}) = \sqrt{2-2\cos(\frac{9\pi}{25}}) = \sqrt{2-\sqrt{2+2\cos(\frac{18\pi}{25}}}) = \sqrt{2-\sqrt{2-2\cos(\frac{7\pi}{25}}}) = \sqrt{2-\sqrt{2-\sqrt{2+2\cos(\frac{14\pi}{25}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-2\cos(\frac{11\pi}{25}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+2\cos(\frac{22\pi}{25}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-2\cos(\frac{3\pi}{25}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+2\cos(\frac{6\pi}{25}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+2\cos(\frac{12\pi}{25}}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+2\cos(\frac{24\pi}{25}}}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2-2\cos(\frac{\pi}{25}}}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2-\sqrt{2+2\cos(\frac{2\pi}{25}}}}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2-\sqrt{2+\sqrt{2+2\cos(\frac{4\pi}{25}}}}}}}}}}) = \sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+2\cos(\frac{8\pi}{25}}}}}}}}}}})$
Above cycle repeats infinitely
$2\cos\frac{8\pi}{25} = cin\sqrt2[4-2+1-3+]$ single cycle contains $5 +$ signs and $5 -$ signs and is simple representation of $\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+...}}}}}}}}}}$
Steps can be simplified as follows.
- When the angle exceeds $\frac{\pi}{2}$ we are applying the basic cosine angle identity $2\cos(\pi-\theta) = -2\cos(\theta)$
- Doubling happens infinitely with $\frac{\pi}{4} < \theta < \pi$
- As the denominator in the angle is odd number, when the $\frac{numerator}{denominator} > \frac{1}{2}$ the signs changes while doubling the cosine angle expansion as nested radical.
Above steps are programmable.
I have created a program to calculate the number of $'+'$ and $'-'$ signs in cyclic infinite nested square roots of 2 for cosine values in Python as follows and anyone can verify which will provide the result for any odd number other than 3 (I am not expert in this)
import time
n = int(input("Enter an odd number to get single cycle cinsqrt2 ")) #odd number is denominator
# steps to calculate numerator as $2^n$ so that fraction lies between 0.25 and 0.5
i = 0
for i in range(n):
if 2 ** i > n and n < 2 ** (i + 1):
break
numerator = 2 ** (i - 2)
print("Numerator is", numerator)
#print("The Angle generated is", (numerator*180)/n, (numerator*180)//n,'+', ((numberator*180)%n)/n)
halfway_of_n = (n - 1) // 2 #to decide the sign, we need halfway number
# print("Half way to n is", halfway_of_n)
lst = []
r = numerator * 2
begin = time.time()
while r != numerator:
if r > halfway_of_n:
r = n - r
r = r * 2
lst = lst + ['-']
else:
r = r * 2
lst = lst + ['+']
lst = lst + ['+']
print(len(lst))
count = lst.count('-')
print('No of minus signs is/are ', count)
count = lst.count('+')
print('No of plus signs is/are ', count)
print(lst) #list containing '+' and '-' signs
end = time.time()
print('Program execution time is', end - begin)
$2\cos\frac{32\pi}{125} = cin\sqrt2[2-4+1-1+1-2+2-1+2-1+1-1+2-2+3-1+3-3+1-2+1-1+5-1+1-5+]$ single cycle contains $25 +$ signs and $25 -$ signs and (representing this as a infinite nested radical will be big and occupy big space. Therefore I'm representing in the simplified form as shown above)
Exciting pattern emerges for cosine values having exponent of 5 in the denominator and number of + and - signs in the $cin\sqrt2$ which also exponentially growing as follows
for $5^1$ in denominator $5^0 + 5^0$ signs in total (in single cycle)
for $5^2$ in denominator $5^1 + 5^1$ signs in total (in single cycle)
for $5^3$ in denominator $5^2 + 5^2$ signs in total (in single cycle)
for $5^4$ in denominator $5^3 + 5^3$ signs in total (in single cycle)
and so on
Question: Any other way to get these signs inside the nested radicals in a better way?