4

Let $p$ be a prime where $-1$ is not a quadratic residue, (no solutions to $m^2 = -1$ in $p$).

I want to find an easily computable expression for

$$\sum_{k=0}^n {n \choose 2k} (-x)^k$$

modulo $p$. With one caveat, all the computations must be done over the integers modulo $p$, no complex numbers.

That is, I'm ruling out the standard trick where you take $(1+xi)^n + (1-xi)^n$ to extract even terms.

I'm looking for any other alternate expressions for this sum. The final expression should not have a sum over $n$ terms and not involve any complex numbers implicitly or explicitly. For example, Chebyshev functions are ruled out, as they implicitly involve a complex power.

Other than that any interesting expressions for the sum over the integers or the integers modulo $p$ are allowed. Can anyone do it?

$\textbf{Rephrase}$

Any way of writing the real part of $(1+xi)^n$ modulo $p$, as $f(x,n)$ for some $f$ that only involves real numbers in the computation and no sum over $n$.

For example, $f(x,n)$ can not be a polynomial in $x^n$ because $f(x,n)$ would be periodic modulo $p-1$ in $n$, while $(1+xi)^n$ would be periodic modulo $p^2-1$ (and not $p-1$). So the function $f$ would have to be quite intricate.

mtheorylord
  • 4,274
  • 1
    Why do you say that the standard trick does not work? You can work in the ring $\Bbb Z / p \Bbb Z [X] / (X^2+1)$, which essentially is the ring of integers modulo $p$ where you have an element $i$ with $i^2=-1$. – Crostul Aug 25 '23 at 22:06
  • what is $n$? any number without constraint? – cr001 Aug 25 '23 at 22:06
  • @Crostul yeah, you can work in that ring but you would still need to determine $(1+i)^n$ mod $p$ which is just as difficult. I wasn't able to find a solution. – mtheorylord Aug 25 '23 at 22:17
  • Yes, $n$ is any number @cr001 – mtheorylord Aug 25 '23 at 22:18
  • 6
    Is there some reason you expect there to be a better answer than just saying that it's $(1+i)^n+(1-i)^n$ mod $p$? – Eric Wofsey Aug 25 '23 at 22:46
  • What is $x$, a variable or a fixed number? – Alex Ravsky Sep 27 '23 at 18:05
  • 1
    $x$ is a fixed number. – mtheorylord Sep 27 '23 at 18:07
  • It's not "difficult" to compute $,(a+bi)^n\bmod p,,$ e.g. repeated squaring is very fast. – Bill Dubuque Sep 27 '23 at 19:11
  • I'm aware, but I'm trying to write $(a+bi)^n$ as some function like $a^n$. Obviously, difficult because the periods are different. – mtheorylord Sep 27 '23 at 19:12
  • But that series bisection $,(1+ix)^n + (1-ix)^n,$ is already a closed-form that is quickly computable by repeated squaring $!\bmod p.,$ What more do you want? – Bill Dubuque Sep 27 '23 at 19:14
  • I want to find some way interesting ways to write the parts of $(a+bi)^n$ as a function over the reals. – mtheorylord Sep 27 '23 at 19:43
  • It seems that if the doubled sum to calculate is $(1+xi)^n + (1-xi)^n$ then the sum should be $\sum_{k=0}^{{\color{red}{\lfloor n/2\rfloor}}} {n \choose 2k} (-x)^k$. – Alex Ravsky Sep 27 '23 at 19:46
  • 2
    Further, as in mod order reduction, we can reduce exponents using the quadratic analog of little Fermat $,(a+bi)^{p^2-1}\equiv 1,,$ and $(a+bi)^p\equiv a-bi\pmod{!p}\ \ $ – Bill Dubuque Sep 27 '23 at 19:46
  • Your question says you seek "easily computable" ways. We've given you poly-time algorithms above. It's unlikely that can be improved in general. But you reject that and now say you seek "interesting ways...". This is very vague. Please edit your question to be more precise about what you seek. – Bill Dubuque Sep 27 '23 at 19:49
  • I'm trying to find a way to write powers $x^k$ as a the real part of $(a+bi)^l$ for some norm $1$ element $a+bi$. Solving the above question would help.

    So sort of connection between $(a+bi)^k$ and $x^k$ modulo $p$. They have different order so nothing trivial works.

    The question is very open ended. But finding interesting ways to write $(1+xi)^k$ over the reals would help.

    – mtheorylord Sep 27 '23 at 19:55
  • We can calculate $T_n=(1+xi)^n + (1-xi)^n$ using the following recurrence: $T_0=T_1=2$, and $T_{n+1}=2T_n+(x^2+1)T_{n-1}$ for each natural $n\ge 2$. – Alex Ravsky Sep 27 '23 at 19:59
  • Yes, that's equivalent to Chebyshev @AlexRavsky.

    My fully general question is trying to understand the behaviour of $Re[ (a+bi)^k] = a^n$ modulo $p$ for what $n$ and $k$?

    – mtheorylord Sep 27 '23 at 20:00
  • $k = 0..n$ so how do you compute $(n - 2k)!$ when you expand the binomial coefficient. Therefore that's complex function heavy area – Daniel Donnelly Oct 01 '23 at 03:16

0 Answers0