Let $t$ be a positive integer, let $p$ be a prime number, and let $q$ be a real number. I need to evaluate the sum $$ \sum_{\substack{1 \leq c \leq t \\ c \not \equiv 1 \pmod{p}}} q^{-\big((p-2)c + \lfloor\frac{c-2}{p}\rfloor\big)}. $$ This can be done via elementary methods by writing $c-2 = ap + b$ for $0 \leq b < p$, and converting the conditions on $c$ into conditions on $a$ and $b$. Evaluating the nested sums $\sum_a \sum_b$ then gives a solution (I haven't actually computed it though, since it would be quite unpleasant).
Since this is conceptually so straightforward, I feel that there must be a way to do it using symbolic computation software. Ideally, I would like to be able to tell the computer the original problem and get a closed form answer automatically.
The best I've found so far is Sage's symbolic_sum, which still seems not to do what I want, since it doesn't understand the condition that $c \not\equiv 1\pmod{p}$, or the floor division in $\lfloor \frac{c-2}{p}\rfloor$.
Does anyone have any suggestions on how to do this as painlessly as possible? I have a few other similar sums that need to be done, but I think any solution to this one will also apply to the others.