The Question
How many unique values of $\cos(\frac{a\pi}{N})\cos(\frac{b\pi}{N})$ are there for the positive integers $a,b < N$ for a given $N$? I would like a function $f(N)$ which gives that number of unique values.
Upper Bound
It can be shown that for even $N$, $f(N)$ is inclusive upper bounded by $$f'(N) = (\sum_{n=1}^{N/2}n) + 1$$
In fact, for many values of N, $f(N) = f'(N)$. This upper bound is easier to show from the equivalent formulation of the problem as discussed at the bottom of this question.
Example
N = 12 is the smallest even N such that $f(N)\lt f'(N)$, there is one duplicate value for N = 12:
$$\cos(\frac{3\pi}{12})\cos(\frac{3\pi}{12}) = \cos(\frac{0\pi}{12})\cos(\frac{4\pi}{12})$$
So $f(12) = 21$, while $f'(12) = 22$.
Sequence
I have calculated the sequence $f(N)$ for $0<N<70$ as follows:
1, 2, 4, 4, 7, 7, 11, 11, 16, 16, 22, 21, 29, 29, 36, 37, 46, 45, 56, 56, 67, 67, 79, 77, 92, 92, 106, 106, 121, 116, 137, 137, 154, 154, 172, 170, 191, 191, 211, 211, 232, 232, 254, 254, 276, 277, 301, 299, 326, 326, 352, 352, 379, 377, 407, 407, 436, 436, 466, 458, 497, 497, 529, 529, 562, 560, 596, 596, 631
and for even integers $0 < N < 70$, the sequence of $f'(N) - f(N)$ is:
0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 5, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 8, 0, 0, 2, 0
Neither of these integer sequences are present on https://oeis.org/.
Equivalent formulation
Where $\omega_N$ is the $N^{th}$ root of unity, how many unique values of $(\omega^a_N + \omega^{-a}_N)(\omega^b_N + \omega^{-b}_N)$ are there for a given N?
This question has arisen for me while analyzing the spectra of the tensor product of two same-sized cyclic groups. I can expand on this context if it would be helpful for solving the problem.
I do have some additional, various, disconnected insight into the problem. But for the sake of clarity of the question, I will end the question here. Thank you, any insight and/or discussion is appreciated.