Let $T(c, k, p) := \sum_{i = 0}^{k} \left( \frac{i^2 + c}{p} \right) $, where $p$ is a prime number. It is known, that $T(c, p - 1, p) = -1$ for $p \nmid c$. Now, I would like the sequence $T(c, 0, p), T(c, 1, p), \ldots, T(c, p - 1, p)$ to be non-positive. So I wrote a program for searching such pairs $c < p$ and the result is quite interesting: there is no such pair for $c \in [12, 999]$ and $p < 200000$. The pairs that were found are $\{(2, 3), (2, 5), (2, 11), (3, 5), (3, 7), (5, 7), (5, 13), (5, 17), (6, 7), (6, 13), (7, 11), (10, 11), (11, 13)\}$.
So here is my question:
Are these the only pairs $c < p$ for which all partial sums of $\left( \frac{0^2 + c}{p} \right), \left( \frac{1^2 + c}{p} \right), \ldots, \left( \frac{(p-1)^2 + c}{p} \right)$ are non-positive?
Another question is whether for given $c$ the first moment when this partial sum achieves a positive value is bounded by some constant. In other words whether $\forall_{c \in \mathbb{N}} \exists_{C_c} \forall_{p \in \mathbb{P}, p > C_c} \exists_{k \in \mathbb{N}, k < C_c} T(c, k, p) > 0$. I believe that the answer for this one is negative.
EDIT: regarding the first question, all partial sums are non-positive iff they all belong to $\{0, -1, -2\}$. So it would be enough to prove that for sufficiently large $p$ there will always be 3 consecutive quadratic residues or 3 consecutive quadratic nonresidues in $\left( \frac{0^2 + c}{p} \right), \left( \frac{1^2 + c}{p} \right), \ldots, \left( \frac{(p-1)^2 + c}{p} \right)$. I know that stronger result holds for the sequence $\left( \frac{0}{p} \right), \left( \frac{1}{p} \right), \ldots, \left( \frac{p-1}{p} \right)$, but I don't know the proof of it. Perhaps a similar approach could solve my problem?
EDIT2: it could and it does.
I managed to answer my own question. Those are in fact all such pairs.
Here is a sketch of the proof:
1) Partial sums are all non-positive $\Leftrightarrow$ they belong to $\{0,-1,-2\}$. It is because there is a nice symmetry in this sequence.
2) Show that if $p > 2k$ then all polynomials of form $((x+a_0)^2 + c) ((x+a_1)^2 + c) \ldots ((x+a_l)^2 + c)$, where $0 \leq a_0 < \ldots < a_l < k$ are all integers, considered as elements of $\mathbb{Z}_p[X]$ have a root that occurs in an odd power. In other words, such polynomials are not of form $\text{constant} \cdot \text{squared polynomial}$ in $\mathbb{Z}_p[X]$. We need this for the next point.
3) Use Weil's bound in a similar way as in here: https://mathoverflow.net/a/161279 to prove that for sufficiently large $p$ there will be a sequence of $3$ consecutive quadratic residues in the sequence $\left( \frac{0^2 + c}{p} \right), \left( \frac{1^2 + c}{p} \right), \ldots, \left( \frac{(p-1)^2 + c}{p} \right)$, which contradicts with non-existence of partial sum outside $\{0,-1,-2\}$.
4) Check all smaller primes using computers.
In fact we can use this method to prove that $\forall_{l < r} \exists_{N} \forall_{p \in \mathbb{P}, p > N} \forall_{c \in \mathbb{N}, 0 < c < p} \exists_{0 \leq k < p} T(c, k, p) \not\in [l, r]$