Generalizing a Trig Identity

I assume this can be calculated using Chebyshev polynomials. If we use the identity $\cos\frac{x}{k^{n-j}}=T_{k^j}(\cos\frac{x}{k^n})$ and $\prod\limits_{j=1}^n \cos\frac{x}{k^j}=\prod\limits_{j=0}^{n-1} \cos\frac{x}{k^{n-j}}=\prod\limits_{j=0}^{n-1}T_{k^j}(\cos\frac{x}{k^n})$ and $2 T_m(x) T_n(x) = T_{m+n}(x) + T_{|m-n|}(x)$.

One more step: For $B=\frac{x}{k^n}, A=\cos B, T_{1}(A)*T_{k}(A)*T_{k^2}(A)*T_{k^3}(A)...=\frac{1}{2}(T_{k+1}(A) + T_{k-1}(A))*T_{k^2}(A)*T_{k^3}(A)=\frac{1}{4}(T_{k^2+(k+1)}(A)+T_{k^2-(k+1)}(A) + T_{k^2+(k-1)}(A)+T_{k^2-(k-1)}(A))*T_{k^3}(A)=\frac{1}{8}(T_{k^3+(k^2+(k+1))}(A)+T_{k^3-(k^2+(k+1))}(A)+T_{k^3+(k^2-(k+1))}(A)+T_{k^3-(k^2-(k+1))}(A) + T_{k^3+(k^2+(k-1))}(A)+T_{k^3-(k^2+(k-1))}(A)+T_{k^3+(k^2-(k-1))}(A))+T_{k^3-(k^2-(k-1))}(A))...$

For k=2 the $k^3-k^2-k-1,k^3-k^2-k+1,k^3-k^2+k-1,... $ are the list of odd numbers $1,3,5,7...,2^{n}-1$. In order to simplify the understanding lets consider the case $n=4$ $T_{1}(A)*T_{k}(A)*T_{k^2}(A)*T_{k^3}(A)=T_{1}(\cos B)+T_{3}(\cos B)+T_{5}(\cos B)+...+T_{15}(\cos B)=\cos{(1*B)} + \cos{(3*B)} + \cos{(5*B)} + ... +\cos{(15*B)}=\frac{1}{2}\frac{\sin 16B}{\sin B} $ and accordingly $\prod\limits_{j=1}^4 \cos\frac{x}{k^j}=\frac{1}{2^{4-1}}\frac{1}{2}\frac{\sin 16B}{\sin B}=\frac{1}{2^{4}}\frac{\sin x}{\sin \frac{x}{16}}$.

If we follow the prove we will see that the key point in prove was:

1) the appearing of odd numbers in the sequence of $k^3-k^2-k-1,k^3-k^2-k+1,k^3-k^2+k-1,... $ for $k=2$

2) The sum of $\cos{(1*B)} + \cos{(3*B)} + \cos{(5*B)} + ... +\cos{((2^{n}-1)*B)}=\frac{1}{2}\frac{\sin 2^n B}{\sin B}$

If we perform further investigation we will see that the point 1 can be generalized for any k>2. It will bring us to sequence defined in OEIS as: "Sequence S such that 1 is in S and if x is in S, then $k*x-1$ and $k*x+1$ are in S". See the

https://oeis.org/A147991 for k=3 $1, 2, 4, 5, 7, 11, 13, 14, 16, 20, 22, 32, 34, ....$

and https://oeis.org/A147992 for k = 4. $1, 3, 5, 11, 13, 19, 21, 43, 45, 51, 53, 75, 77, 83, 85,..$

While the generalization of point 2 is impossible. It expects the sum of cosines over this coeffs*B to bring to some definite result. But I think for k>2 this will not be a case. In order to understand my point lets consider the sum $\prod\limits_{j=1}^4 \cos\frac{x}{k^j}=2^{-3}(\cos{(43*B)} + \cos{(45*B)} + \cos{(51*B)} + ... +\cos{(85*B)})$ for $k=4$. I think there is no simpler trigonometric relation for this.

So I think for the products you expect there will not be any simple form, except the case k=2.

The exact formula for the sum is:

$\prod\limits_{j=1}^n \cos\frac{x}{k^j}=2^{-n+1}\sum\limits_{i=2^{n-1}}^{2^{n}-1}\cos{(a_{k}(i)*\frac{x}{k^n})} $

where:

for $k=2$ the $a_k(i)$ is https://oeis.org/A006257 $1, 1, 3, 1, 3, 5, 7, 1, 3, 5, 7, 9, 11, 13, 15,...$

for $k=3$ the $a_k(i)$ is https://oeis.org/A147991 $1, 2, 4, 5, 7, 11, 13, 14, 16, 20, 22, 32, 34, ...$

for $k=4$ the $a_k(i)$ is https://oeis.org/A147992 $1, 3, 5, 11, 13, 19, 21, 43, 45, 51, 53, 75, 77, 83, 85,...$

for $k=5$ the $a_k(i)$ is https://oeis.org/A153777 $1, 4, 6, 19, 21, 29, 31, 94, 96, 104, 106, 144, 146, 154, 156,...$

This $a_k(i)$ sequence can be simply generalized for any k.

And finally one amazing result: $\prod\limits_{j=0}^{n-1} \cos{k^j}=2^{-n+1}\sum\limits_{i=2^{n-1}}^{2^{n}-1}\cos{(a_{k}(i))} $