mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Computer Science & Computational Number Theory (https://www.mersenneforum.org/forumdisplay.php?f=116)
-   -   Efficient computation of cubic residue (https://www.mersenneforum.org/showthread.php?t=19948)

 axn 2015-01-02 06:29

Efficient computation of cubic residue

Given a prime p = 1 (mod 3) and a small prime q < p, how can I quickly tell if q is a cubic residue (mod p)? I can do it slowly by checking if q^((p-1)/3) == 1, but is there a faster method?

Alternatively, how can I efficiently find a cubic non residue (mod p) without searching?

 Batalov 2015-01-03 20:31

You probably have seen [URL="http://mathoverflow.net/questions/136296/on-cubic-non-residues-modulo-a-prime"]this[/URL], but just in case.

Somewhere else I think I noticed a comment that Magma does first 80 small primes before trying clever things (and so does your gfnsvCUDA for quadratic nonr). We can look up in Pari's code, too, but I vaguely remember hearing that it does the same... And between Magma and Pari, people surely care about efficiency so it seems like the tried and true way to approach the qnr.

 CRGreathouse 2015-01-04 03:49

I remember Bernstein has a clever algorithm for some nonresiduosity problem (quadratic, cubic, or general, I don't remember). He begins the paper, IIRC, by explaining that for all practical purposes you should search directly and that this algorithm is of theoretical interest only. This agrees with Batalov's post above.

 All times are UTC. The time now is 16:08.