8 added 3 characters in body

Thanks to the comments of George Lowther and Greg Martin (for which I am most grateful), I can now show that the answer is YES for infinitely many primes $q$.

Theorem 1. Let $(t_i)_{i=0}^{n-1}$ t_1\dots,t_{n-1}$be a any finite sequence set of nonzero real numbers such that$t_0$is rational. Then numbers.Then for any$\epsilon>0$and any integer$r>0$there are infinitely many primes$q$q\equiv 1\pmod{r}$ such that $$\|(q-1)t_i\|<\epsilon,\qquad i=0,\dots,n-1.\tag{1}$$ i=1,\dots,n-1.\tag{1}$$Here \|x\| stands for the distance of x to the nearest integer. Proof. Without loss of generality, the elements of numbers (t_i)_{i=0}^{n-1} 1,t_1,\dots,t_{n-1} are linearly independent over \mathbb{Q}. Indeed, we can express each element of them as a \mathbb{Z}-linear combination from a suitable basis (t_j^*)_{i=0}^{m-1} \frac{1}{s},t_1^*,\dots,t_{m-1}^* of their \mathbb{Q}-linear span, and without loss of generality where t_0^* s>0 is rationalan integer. Then the statement for (t_i)_{i=0}^{n-1} t_1,\dots,t_{n-1} follows from the statement for (t_j^*)_{i=0}^{m-1}. t_1^*,\dots,t_{m-1}^* (with \mathrm{lcm}(r,s) in place of r). When the elements of (t_i)_{i=0}^{n-1} 1,t_1,\dots,t_{n-1} are linearly independent over \mathbb{Q}, the statement follows from the stronger result that the vectors (qt_1,\dots,qt_{n-1}) are dense modulo 1, as q runs through the primes in any arithmetic progression of the form such that q\equiv 1\pmod{m}1\pmod{r}. This result is essentially due to Vinogradov, with technical improvements by Vaughan and Harman. See Theorem 4 in Harman: Diophantine approximation with primes, J. London Math. Soc. (2) 39 (1989), 405–413. Well, Harman does not have the condition q\equiv 1\pmod{m}1\pmod{r}, but it seems straightforward to include incorporate it. Theorem 2. Let t_i, f_i, F be as in the original question but without the assumption f_i\in\mathbb{Z}. Then for any \epsilon>0 there is a prime q such that$$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|< \epsilon.$$In particular, if F is integer valued and \epsilon=1, then the left hand side is zero. Proof. Assume that \epsilon>0 is sufficiently small, namely$$\epsilon<\|t_i\|,\qquad i=1,\dots,n-1.\tag{2}$$By Theorem 1, there is a prime q such that (1) holds. Observe that$$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl([qt_{i+1}]-[qt_i]\bigr)+f_{n-1}\bigl(q-1-[qt_{n-1}]\bigr),$$where [x] stands for the integral part of x. Here we used that no \frac{j}{q} coincides with any t_i, as follows from (1) and (2). We subtract$$0=(q-1)\int_0^1 F(t)dt=\sum_{i=0}^{n-1}f_i\bigl((q-1)t_{i+1}-(q-1)t_i\bigr),$$then with the notation$$\tilde t_i:=[qt_i]-(q-1)t_i,\qquad i=0,\dots,n-1,$$we get$$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl(\tilde t_{i+1}-\tilde t_i\bigr)-f_{n-1}\tilde t_{n-1}=\sum_{i=1}^{n-1}(f_{i-1}-f_i)\tilde t_i.$$By (1) we can write (q-1)t_i=n_i+e_i with n_i\in\mathbb{Z} and |e_i|<\epsilon. Then$$qt_i = n_i+t_i+e_i,\qquad i=1,\dots,n-1,$$whence by (2), that is by \epsilon<\min(t_1,1-t_{n-1}), we have [qt_i]=n_i, so that \tilde t_i=-e_i. It follows that$$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=1}^{n-1}(f_i-f_{i-1})e_i,$$whence$$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|<\epsilon\sum_{i=1}^{n-1}|f_i-f_{i-1}|.$$The right hand side can be made arbitrary small, so we are done. 7 added 393 characters in body Thanks to the comments of George Lowther and Greg Martin (for which I am most grateful), I can now show that the answer is YES for infinitely many primes q. Theorem 1. Let (t_i)_{i=1}^{n-1} (t_i)_{i=0}^{n-1} be an arbitrary a finite sequence of nonzero real numbers such that t_0 is rational. Then for any \epsilon>0 there are infinitely many primes q such that$$\|(q-1)t_i\|<\epsilon,\qquad i=1,\dots,n-1.\tag{1}$$i=0,\dots,n-1.\tag{1}$$ Here $\|x\|$ stands for the distance of $x$ to the nearest integer.

Proof. Without loss of generality, the numbers elements of $1,t_1,\dots,t_{n-1}$ (t_i)_{i=0}^{n-1}$are linearly independent over$\mathbb{Q}$. Indeed, it suffices to establish the result for we can express each element as a$\mathbb{Z}$-linear combination from a suitable basis$(t_j^*)_{i=0}^{m-1}$of the linear their$\mathbb{Q}$-linear span, then and without loss of generality$t_0^*$is rational. Then the general case statement for$(t_i)_{i=0}^{n-1}$follows . from the statement for$(t_j^*)_{i=0}^{m-1}$. When the numbers elements of$1,t_1,\dots,t_{n-1}$(t_i)_{i=0}^{n-1}$ are linearly independent over $\mathbb{Q}$, the statement follows from the stronger result that the vectors $(qt_1,\dots,qt_{n-1})$ are dense modulo $1$, as $q$ runs through the primes in any arithmetic progression of the form $q\equiv 1\pmod{m}$. This result is essentially due to Vinogradov, with technical improvements by Vaughan and Harman. See Theorem 4 in Harman: Diophantine approximation with primes, J. London Math. Soc. (2) 39 (1989), 405–413. Well, Harman does not have the condition $q\equiv 1\pmod{m}$, but it seems straightforward to include it.

Theorem 2. Let $t_i$, $f_i$, $F$ be as in the original question but without the assumption $f_i\in\mathbb{Z}$. Then for any $\epsilon>0$ there is a prime $q$ such that $$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|< \epsilon.$$ In particular, if $F$ is integer valued and $\epsilon=1$, then the left hand side is zero.

Proof. Assume that $\epsilon>0$ is sufficiently small, namely $$\epsilon<\|t_i\|,\qquad i=1,\dots,n-1.\tag{2}$$ By Theorem 1, there is a prime $q$ such that (1) holds. Observe that $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl([qt_{i+1}]-[qt_i]\bigr)+f_{n-1}\bigl(q-1-[qt_{n-1}]\bigr),$$ where $[x]$ stands for the integral part of $x$. Here we used that no $\frac{j}{q}$ coincides with any $t_i$, as follows from (1) and (2). We subtract $$0=(q-1)\int_0^1 F(t)dt=\sum_{i=0}^{n-1}f_i\bigl((q-1)t_{i+1}-(q-1)t_i\bigr),$$ then with the notation $$\tilde t_i:=[qt_i]-(q-1)t_i,\qquad i=0,\dots,n-1,$$ we get $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl(\tilde t_{i+1}-\tilde t_i\bigr)-f_{n-1}\tilde t_{n-1}=\sum_{i=1}^{n-1}(f_{i-1}-f_i)\tilde t_i.$$ By (1) we can write $(q-1)t_i=n_i+e_i$ with $n_i\in\mathbb{Z}$ and $|e_i|<\epsilon$. Then $$qt_i = n_i+t_i+e_i,\qquad i=1,\dots,n-1,$$ whence by (2), that is by $\epsilon<\min(t_1,1-t_{n-1})$, we have $[qt_i]=n_i$, so that $\tilde t_i=-e_i$. It follows that $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=1}^{n-1}(f_i-f_{i-1})e_i,$$ whence $$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|<\epsilon\sum_{i=1}^{n-1}|f_i-f_{i-1}|.$$ The right hand side can be made arbitrary small, so we are done.

6 edited body

Thanks to the comments of George Lowther and Greg Martin (for which I am most grateful), I can now show that the answer is YES for infinitely many primes $q$.

Theorem 1. Let $(t_i)_{i=1}^{n-1}$ be an arbitrary finite sequence of real numbers. Then for any $\epsilon>0$ there are infinitely many primes $q$ such that $$\|(q-1)t_i\|<\epsilon,\qquad i=1,\dots,n-1.\tag{1}$$ Here $\|x\|$ stands for the distance of $x$ to the nearest integer.

Proof. Without loss of generality, the numbers $1,t_1,\dots,t_{n-1}$ are linearly independent over $\mathbb{Q}$. Indeed, it suffices to establish the result for a basis of the linear span, then the general case follows. When the numbers $1,t_1,\dots,t_{n-1}$ are linearly independent over $\mathbb{Q}$, the statement follows from the stronger result that the vectors $(qt_1,\dots,qt_{n-1})$ are dense modulo $1$, as $q$ runs through the primes. This result is essentially due to Vinogradov, with technical improvements by Vaughan and Harman. See Theorem 4 in Harman: Diophantine approximation with primes, J. London Math. Soc. (2) 39 (1989), 405–413.

Theorem 2. Let $t_i$, $f_i$, $F$ be as in the original question but without the assumption $f_i\in\mathbb{Z}$. Then for any $\epsilon>0$ there is a prime $q$ such that $$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|< \epsilon.$$ In particular, if $F$ is integer valued and $\epsilon=1$, then the left hand side is zero.

Proof. Assume that $\epsilon>0$ is sufficiently small, namely $$\epsilon<\|t_i\|,\qquad i=1,\dots,n-1.\tag{2}$$ By Theorem 1, there is a prime $q$ such that (1) holds. Observe that $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl([qt_{i+1}]-[qt_i]\bigr)+f_{n-1}\bigl(q-1-[qt_{n-1}]\bigr),$$ where $[x]$ stands for the integral part of $x$. Here we used that no $\frac{j}{q}$ coincides with any $t_i$, as follows from (1) and (2). We subtract $$0=(q-1)\int_0^1 F(t)dt=\sum_{i=0}^{n-1}f_i\bigl((q-1)t_{i+1}-(q-1)t_i\bigr),$$ then with the notation $$\tilde t_i:=[qt_i]-(q-1)t_i,\qquad i=0,\dots,n-1,$$ we get $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=0}^{n-2}f_i\bigl(\tilde t_{i+1}-\tilde t_i\bigr)-f_{n-1}\tilde t_{n-1}=\sum_{i=1}^{n-1}(f_{i-1}-f_i)\tilde t_i.$$ By (2) 1) we can write $(q-1)t_i=n_i+e_i$ with $n_i\in\mathbb{Z}$ and $|e_i|<\epsilon$. Then $$qt_i = n_i+t_i+e_i,\qquad i=1,\dots,n-1,$$ whence by (2), that is by $\epsilon<\min(t_1,1-t_{n-1})$, we have $[qt_i]=n_i$, so that $\tilde t_i=-e_i$. It follows that $$\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)=\sum_{i=1}^{n-1}(f_i-f_{i-1})e_i,$$ whence $$\left|\sum_{j=1}^{q-1}F\left(\frac{j}{q}\right)\right|<\epsilon\sum_{i=1}^{n-1}|f_i-f_{i-1}|.$$ The right hand side can be made arbitrary small, so we are done.