**It is claimed that the following function produces only integer values for all integer $m \geq 1$, $N \geq 2$.**


$F(m,N)=\frac{N^m}{2^m}\displaystyle \sum\_{j=1}^{N-1} \operatorname{cosec} ^{2m}\left(\frac{\pi j}{N}\right)$


**How do I prove this?**


(Source: <https://twitter.com/SamuelGWalters/status/1513266704855363587> - and extensive testing numerically makes me reasonably confident it is true).


*Edit to say that now I have found a solution, the following comments are not necessary to tackle the problem (but might provide further insight into F).*


I found this paper: fq.math.ca/Papers1/44-3/quartgauthier03\_2006.pdf. I used the method there to express $F$ solely in terms of rational numbers - in outline, this went as follows...


Writing $g\_m(z) = \text{cosec}^{2m+2}(z)$ it can be shown that


$\frac{d^{2}}{dz^{2}}g\_m(z) = (2m+2)(2m+3)g\_{m+1}(z)-(2m+2)^2g\_m(z)$


and so writing


$g\_m(z)=\displaystyle\sum\_{r=0}^m \phi\_{r,m} \frac{d^{2r}}{dz^{2r}}[g\_0(z)]$


we can establish that


$\phi\_{r,m}=0$ for $r <0$ and $r>m$,


$\phi\_{0,0}=1$,


$\phi\_{r,m+1}=\large \frac{\phi\_{r-1,m}+(2m+2)^2\phi\_{r,m}}{(2m+2)(2m+3)}$


From the Mittag-Leffler theorem,


$g\_0(z)=\displaystyle\sum\_{n\in\mathbb{Z}}(z-n\pi)^{-2}$ so


$\frac{d^{2r}}{dz^{2r}}[g\_0(z)]=(2r+1)!\displaystyle\sum\_{n\in\mathbb{Z}}(z-n\pi)^{-2(r+1)}$


This enables us to write:


$F(m,N)=\displaystyle\sum\_{r=1}^{m}(2r-1)!\phi\_{r-1,m-1}T\_{r,m}(N)$


where $T\_{r,m}(N)=\displaystyle \frac{N^{m+2r}}{2^m\cdot\pi^{2r}}\displaystyle \sum\_{j=1}^{N-1}\displaystyle\sum\_{n\in\mathbb{Z}}( j-nN)^{-2r}$


Then using properties of the Riemann-zeta function, including for integer $r$ that $\zeta(2r)=2^{2r-1}|B\_{2r}|\pi^{2r}/(2r)!$, where $(B\_{2r})$ are Bernouilli numbers it can be shown that


$T\_{r,m}(N) = 2^{2r-m}(N^{2r+m}-N^m)|B\_{2r}|/(2r)!$


**In summary,**


**$F(m,N)=\displaystyle\sum\_{r=1}^{m}2^{2r-m-1} r^{-1} \phi\_{r-1,m-1} |B\_{2r}|N^m(N^r-1)(N^r+1)$**


**$\phi\_{r,m}$ as defined above.**


For reference, $B\_0 = 1$, $B\_1 = \frac12$, $B\_r = 0$ for odd $r > 1$,


$\displaystyle \sum\_{k=0}^m {m+1 \choose k}B\_k=m+1$


**How can I show $F(m,N)$ is always an integer for $m \geq 1, N \geq 2$?**




---


*ADDITIONAL NOTE*


For reference, by numerical grind, I have found these formulae (and confirmed they give integer values):


$F(1,N) = N(N-1)(N+1)/(2 \cdot 3)$


$F(2,N) = N^2 (N-1)(N+1)(N^2+11)/(2^2 \cdot 3^2 \cdot 5)$


$F(3,N) = N^3(N-1)(N+1)(2N^4+23N^2+191)/(2^3 \cdot 3^3 \cdot 5 \cdot 7)$


$F(4,N) = N^4(N-1)(N+1)(3N^6+43N^4+337N^2+2497)/(2^4 \cdot 3^4 \cdot 5^2 \cdot 7)$


$F(5,N) = N^5(N-1)(N+1)(4N^8 + 70N^6 + 642N^4 + 4250N^2 + 29594)/(2^6 \cdot 3^5 \cdot 5 \cdot 7 \cdot 11)$


and just in case you think you've spotted a pattern:


$F(6,N) = N^6(N-1)(N+1)(1382N^{10} + 28682N^8 + 307961N^6 + 2295661N^4+13803157N^2+92427157)/k$


where $k=2^6\cdot 3^6 \cdot 5^3 \cdot 7^2 \cdot 11 \cdot 13$


Also, for all $m$,


$F(m,2) = 1$


$F(m,3) = 2^{m+1}$


$F(m,4) = 2^{m}(2\cdot2^m+1)$


$F(m,5) = 2((5+\sqrt{5})^m + (5-\sqrt{5})^m)$


$F(m,6) = (3^m + 1)(2^{2m+1}+1)-1$


$F(m,7) = $?


$F(m,8) = 2^{2m}(2^{m+1}(2+\sqrt{2})^m+2^{m+1}+2^{m+1}(2-\sqrt{2})^m+1)$


[each of these can be shown from the original definition of $F$ using known values of $\text{cosec}(\pi/N)$]



How to prove this sum involving powers of cosec is an integer?
*It turns out rewriting the function in terms of Bernouilli numbers etc, while useful in generating specific values of $F(m,N)$, is not an easy path to proving they are integers. The following proof is reasonably elementary (knowledge of complex $n$th roots of $1$, no calculus) and is drawn from D. Zagier, Elementary Aspects of the Verlinde Formula and of the Harder-Narasimhan-Atiyah-Bott Formula, Israel Math. Conf. Proc. 9 (1996) - see Theorem 1 part (vii). (I've given more detail on some of the steps, and structured it to focus on the proof of integral value).*


*PS - I'm an actuary, with no academic credentials beyond a Maths BA from 30 years ago, but I've enjoyed reading your comments and finding a solution to a tweet that I read 1 year ago (almost to the day!) and which has bugged me ever since.*


**APPROACH**


Fix N.


(1) We will define a function $f(g,\mathbf{x})$ on integer $g \geq 0$ and $\mathbf{x}=(x\_1,x\_2,...,x\_{N-1})$ for integer $x\_i \geq 0$.


Then, defining $\mathbf{e\_1}=(1,0,0,...0), \mathbf{e\_2}=(0,1,0,...,0), ... \mathbf{e\_{N-1}}=(0,0,...0,1)$


we will show


(2) $f(m+1,\mathbf{0}) = F(m,N)$


(3) $f(0,\mathbf{0})$ is an integer


(4) $f(0,\mathbf{e\_t})$ is an integer


(5) $f(0,\mathbf{e\_t+e\_u})$ is an integer


(6) $f(0,\mathbf{e\_t+e\_u+e\_v})$ is an integer


(7) $\displaystyle \sum\_{t} f(0,\mathbf{x+e\_t})f(0,\mathbf{y+e\_t})=f(0,\mathbf{x+y})$ for all $\mathbf{x,y}$


(8) using (3) - (7), $f(0,\mathbf{x})$ is an integer for all $\mathbf{x}$


(9) $\displaystyle \sum\_{t} f(g,\mathbf{x+2e\_t})= f(g+1,\mathbf{x})$ for all $g$


(10) using (8) - (9), $f(g,\mathbf{x})$ is an integer for all $g$ and $\mathbf{x}$


and so conclude from (2) and (10) that $F(m,N)$ is an integer.


All summations are over $\{1,2,...,N-1\}$.


**STEPS (1), (2)**


(1)


Let


$s(z)=\displaystyle \frac{-2N}{(z - z^{-1})^2}$


$r\_a(z) =\displaystyle \frac{z^{a} - z^{-a}}{z - z^{-1}}$


$r(z,\mathbf{x}) = \displaystyle\prod\_a r\_a(z)^{x\_a}$


$\omega = e^{i \pi / N}$


$f(g,\mathbf{x})=\displaystyle \sum\_{j=1}^{N-1} s(\omega^j)^{g-1}r(\omega^j,\mathbf{x})$


(2)


$s(\omega^j) = \displaystyle\frac{-2N}{(2i\sin(\pi j / N))^2}=\frac{N}{2\sin^2(\pi j / N)}\quad$ and $\quad r(\omega^j,\mathbf{0})=1\quad$ so


$f(m+1,\mathbf{0})=(\frac{N}{2})^m\sum\frac{1}{\sin^{2m}(\pi j/N)} = F(m,N)$


**USEFUL RESULTS**


For the next steps, the following will be useful.


Let $T\_k=\displaystyle \sum\_j \omega^{jk} + \omega^{-jk}$ and $U\_k=\displaystyle\sum\_j \frac{\omega^{jk}-\omega^{-jk}}{\omega^j-\omega^{-j}}$


Then (derivation in footnote):


$\begin{cases} 
T\_k = 2(N-1), & U\_k = 0 & \text{if $k$ is multiple of $2N$} \\ 
T\_k = -2, & U\_k = 0 & \text{if $k$ even, and not a multiple of $2N$}\\
T\_k = 0, & U\_k = N-k+2Nq & \text{if $k$ odd (some integer $q$)}\\
\end{cases}$


**STEPS (3) - (6)**


(3)


$f(0,\mathbf{0}) = \displaystyle \sum\_j \frac{(\omega^j - \omega^{-j})^2}{-2N}=\frac{-1}{2N}\sum (\omega^{2j}+\omega^{-2j}-2)=\frac{-1}{2N}(T\_2 - 2(N-1)) = 1$


(4)


$r(\omega^j, \mathbf{e\_t})= \displaystyle \frac{\omega^{jt} - \omega^{-jt}}{\omega^j - \omega^{-j}}$,


so $r(\omega^j,\mathbf{e\_1})=1$, so $f(0,\mathbf{e\_1})=1$


For $t>1$,


$f(0,\mathbf{e\_t})=\displaystyle -\frac{1}{2N} \sum\_j (\omega^j-\omega^{-j})(\omega^{jt} - \omega^{-jt})=-\frac{1}{2N}(T\_{t+1}-T\_{t-1})=0$


(5)


$r(\omega^j,\mathbf{e\_t+e\_u})=\displaystyle \frac{\omega^{jt} - \omega^{-jt}}{\omega^j - \omega^{-j}}\frac{\omega^{ju} - \omega^{-ju}}{\omega^j - \omega^{-j}}$ so


$f(0,\mathbf{e\_t+e\_u})=-\displaystyle\frac{1}{2N}\sum\_j (\omega^{j(t+u)}+\omega^{-j(t+u)}-\omega^{j(u-t)}-\omega^{-j(u-t)})$


$=-\frac{1}{2N}(T\_{t+u}-T\_{t-u})$ from which


$f(0,\mathbf{e\_t+e\_u})=
\begin{cases} 
1 & \text{if }t = u \\ 
0 & \text{if }t \neq u
\end{cases}$


(6)


$f(0,\mathbf{e\_t+e\_u+e\_v})=\displaystyle -\frac{1}{2N}\sum\_j\frac{(\omega^{jt} - \omega^{-jt})(\omega^{ju} - \omega^{-ju})(\omega^{jv} - \omega^{-jv})}{\omega^j - \omega^{-j}}$


$=-\frac{1}{2N}(U\_{t+u+v}-U\_{t+u-v}+U\_{t-u-v}-U\_{t-u+v})$


If $t+u+v$ etc are even, then this is $0$.


If $t+u+v$ etc are odd, then (since $U\_k = N - k + \text{multiple of $2N$}$)


$U\_{t+u+v}-U\_{t+u-v}+U\_{t-u-v}-U\_{t-u+v}$


$=(t+u+v)-(t+u-v)+(t-u-v)-(t-u+v)+2Nq = 2Nq$ for integer $q$.


So $f(0,\mathbf{e\_t+e\_u+e\_v})$ is an integer.


**ANOTHER USEFUL RESULT**


Let $a\_{jk} =\displaystyle \sum\_t r\_t(\omega^j)r\_t(\omega^k)=\frac{\sum (\omega^{jt} - \omega^{-jt})(\omega^{kt}-\omega^{-kt})}{(\omega^j-\omega^{-j})(\omega^k-\omega^{-k})}$


Along similar lines to (4), this is $0$ except


$a\_{jj}=\displaystyle \frac{1}{(\omega^j - \omega^{-j})^2}(T\_{2j}-2(N-1))=\frac{-2N}{(\omega^j - \omega^{-j})^2}$


So $a\_{jk}=
\begin{cases}
s(\omega^j) & \text{if }j=k\\
0 & \text{otherwise}
\end{cases}$


**STEPS (7) - (10)**


(7)


$\displaystyle \sum\_{t} f(0,\mathbf{x+e\_t})f(0,\mathbf{y+e\_t})$


$=\displaystyle \sum\_t \left[ \sum\_j s(\omega^j)^{-1}\prod\_a r\_a(\omega^j)^{x\_a}\cdot r\_t(\omega^j) \sum\_k s(\omega^k)^{-1}\prod\_b r\_b(\omega^k)^{y\_b}\cdot r\_t(\omega^k) \right]$


$=\displaystyle \sum\_j \sum\_k s(\omega^j)^{-1}s(\omega^k)^{-1}\prod\_a r\_a(\omega^j)^{x\_a}\prod\_b r\_b(\omega^k)^{y\_b}\sum\_t r\_t(\omega^j) r\_t(\omega^k)$


$=\displaystyle\sum\_j s(\omega^j)^{-1} s(\omega^j)^{-1}\prod\_a r\_a(\omega^j)^{x\_a+y\_b}s(\omega^j)$ using the previous result for $a\_{jk}$


$=f(0,\mathbf{x+y})$


(8)


Let $A\_n = \{\mathbf{x}:x\_i \geq 0, x\_1+x\_2+...+x\_{N-1} = n\}$


We prove by induction on $n$, that $f(0,\mathbf{x})$ is an integer for $\mathbf{x} \in A\_n$


The results from (3) - (6) show this is the case for $n \leq 3$.


So pick $n \geq 4$ and assume that the function is an integer for $A\_m$ for all $m < n$.


$\mathbf{x} \in A\_n \implies$ for some $a$ and $b$, $\mathbf{x-e\_a-e\_b} \in A\_{n-2}$


so applying (7), $\displaystyle \sum\_t f(0,\mathbf{x-e\_a-e\_b+e\_t})f(0,\mathbf{e\_a+e\_b+e\_t})=f(0,\mathbf{x})$


So $f(0,\mathbf{x})$ is an integer, because $\mathbf{x-e\_a-e\_b+e\_t} \in A\_{n-1}$ and $\mathbf{e\_a+e\_b+e\_t} \in A\_3$ so these give integer values by induction assumption.


(9)


$\displaystyle \sum\_{t} f(g,\mathbf{x+2e\_t})=\sum\_t \sum\_j s(\omega^j)^{g-1}r(\omega^j,\mathbf{x})r\_t(\omega^j)^2$


$=\displaystyle \sum\_j s(\omega^j)^{g-1}r(\omega^j,\mathbf{x})\sum\_t r\_t(\omega^j)r\_t(\omega^j) = \sum\_j s(\omega^j)^gr(\omega^j,\mathbf{x})$ using the $a\_{jj}$ result


so $\displaystyle \sum\_{t} f(g,\mathbf{x+2e\_t})=f(g+1,\mathbf{x})$


(10)


It is a straightforward induction on $g$ using (8) and (9), to deduce that $f(g,\mathbf{x})$ is an integer for all $g$.


This completes the proof.




---


**FOOTNOTE**


Note that $\omega^{Nk} = (-1)^k$ and $\omega^{-1} = \omega^{2N-1}$


If $k$ is a multiple of $2N$ then $\omega^k = \omega^{-k}=1$, so $T\_k = 2(N-1)$, $U\_k=0$


Otherwise, summing as geometric progressions,


$T\_k= \displaystyle \frac{\omega^k-\omega^{Nk}+\omega^{(N+1)k}-1}{1-\omega^k}$ which simplifies to


$-2$ if $k$ is even and $0$ if $k$ is odd.


It is straightforward to show that


$\displaystyle\frac{\omega^{jk}-\omega^{-jk}}{\omega^j-\omega^{-j}}=\omega^{j(k-1)}+\omega^{-j(k-1)}+\omega^{j(k-3)}+\omega^{-j(k-3)}+...+\omega^{jp}+\omega^{-jp}+a$


where


$p = 2$ and $a=1$ if $k$ is odd,


$p=1$ and $a=0$ if $k$ is even.


Thus $U\_k=T\_{k-1} + T\_{k-3} + ... T\_p+(N-1)a$


If $k$ is even then $U\_k=0$


If $k$ is odd, then $T\_{k-1} + ... + T\_p$ contains $(k-1)/2$ instances of $T\_{\text{even}}$ which are either $-2$ or $-2+2N$, so $U\_k = -(k-1) + 2Nq + (N-1)$ where $q$ counts the occurrences of multiples of $2N$ in $\{2, 4, ... k-1\}$.


So, if $k$ is odd, $U\_k = N-k+2Nq$ for some integer $q$.


