 mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Computer Science & Computational Number Theory (https://www.mersenneforum.org/forumdisplay.php?f=116)
-   -   a new Deterministic primality testing (https://www.mersenneforum.org/showthread.php?t=17537)

 wsc812 2012-12-05 13:21

a new Deterministic primality testing

we know that if $q=4k+3$ ($q$ is a prime), then $(a+bI)^q=a^q+b^q(I)^{4k+3}(mod q) =a -bI$ for every gaussian integer $(a+bi)$ ,Now consider a composite $N=4k+3$ satisfies this condistion for $a+bi=3+2i$, I use Mathematica8 and find no solutison$less than$5\cdot 10^7, can someone find a lager number for the condition . I guess it's impossible for a composite N.So this can be use for Primality test .
__________

We know that if $$q=4k+3$$ ($$q$$ is a prime), then $$(a+bi)^q=a^q+b^q(i)^{4k+3}(mod\ q) =a -bi$$ for every gaussian integer $$(a+bi)$$ ,
Now consider a composite $$N=4k+3$$ satisfies this condistion for $$a+bi=3+2i$$,
I use Mathematica8 and find no solution less than $$5 \cdot 10^7$$, can someone find a larger number for the condition?
I guess it's impossible for a composite N.
So this can be use for Primality test.

 akruppa 2012-12-05 15:07

I haven't found counterexamples up to 10^7, except powers of 3 with odd exponent.

However, I suspect that this might be a kind of combined p-1 and p+1 test in disguise, and for those there are pairs of parameters known for which there is no known counterexample, but no proof of deterministicness (is that a word?), either. See for example [url]http://mathworld.wolfram.com/Baillie-PSWPrimalityTest.html[/url]

 paulunderwood 2012-12-05 15:32

Earlier this year, I tested 2+i for n==3 (mod 4) up to 10^13 without finding a counterexample :smile:

 R. Gerbicz 2012-12-05 18:46

This would be an AKS type test: n=4k+3 is prime iff (2*x+3)^n==3-2*x mod (x^2+1,n)

To see this notice that the minimal polynom of I is x^2+1 (and not x^4-1). This subject is an old topic not to use that many polynom tests for AKS, only a few. Here it would mean only one polynom.

 ewmayer 2012-12-05 21:24

[QUOTE=akruppa;320592]but no proof of deterministicness (is that a word?)[/QUOTE]

My guess would be that the appropriate "suffixing to imply the property of being ___" here is analogous to the one for e.g. "domestic". I love words that, even when spelled correctly, just sound plain wrong: [url=http://www.thefreedictionary.com/coolth]coolth[/url] ... [url=http://www.thefreedictionary.com/gruntled]gruntled[/url] ... "deterministicity" seems a fine addition to this distinguished pantheon.

------------------------------

[i]Edit: Of course using the alternative analogy with e.g. optimistic/pessimistic one arrives at the accepted suffixing here, "determinism" - but where's the fun in that?[/i]

 LaurV 2012-12-06 03:58

[offtopic]
related to that I really have a problem with "primality" because is always underlined red by the spellchecker and that "piss me off" for such a simple word. I tried different forms, even using "r" or "double l" in all variations, but all ended up in being underlined, and I concluded that either there is no word like that, either I am dumb, or the speller is not so clever, therefore I continued to use "primality". So, what is the correct form?
[/offtopic]

 ewmayer 2012-12-06 04:26

[QUOTE=LaurV;320662][offtopic]
related to that I really have a problem with "primality" because is always underlined red by the spellchecker and that "piss me off" for such a simple word. I tried different forms, even using "r" or "double l" in all variations, but all ended up in being underlined, and I concluded that either there is no word like that, either I am dumb, or the speller is not so clever, therefore I continued to use "primality". So, what is the correct form?
[/offtopic][/QUOTE]

I like to alternate between "primerificity" and "primistitude", with an occasional US-pledge-of-allegiance-recalling "indivisibility" (with "by anything other than 1 and n" implied) to keep the spellcheckers from rioting.

 Batalov 2012-12-06 04:38

[QUOTE=LaurV;320662][offtopic]
related to that I really have a problem with "primality" because is always underlined red by the spellchecker and that "piss me off" for such a simple word. I tried different forms, even using "r" or "double l" in all variations, but all ended up in being underlined, and I concluded that either there is no word like that, either I am dumb, or the speller is not so clever, therefore I continued to use "primality". So, what is the correct form?
[/offtopic][/QUOTE]
That was a primal scream.

Have you tried: right-click on the word primality, and "add to dictionary"?

Same with heteroscedacity, [FONT=NimbusRomNo9L-Regu]pseudomarkers, telomeric ...and an endless score of biological and statistical terms. Add them once and never be bothered again. Maybe.[/FONT]

 LaurV 2012-12-06 07:36

Did that for colleagues' names (never remember Thai names!) and other common words which I know they are not English, and even some technical words (same as your biology stuff, but for me is microcontroller, photodiode, etc) which I don't give a darn if they are English or not, as long as I need to use them and everybody understand them. Including my family name, which the auto-substitute was always replacing it with a bad English word, hehe. Those are all complex** words! But primality? grrr.

** That to stay on topic with complex numbers :razz:

Now to really stay on topic, for every odd prime is easy to show that according with its modularity to 4, the expression (3+2i)^n is either 3+2i, either 3-2i. Putting this in a pari line:

[code]
gp > n=3; a=3+2*I; while((n+=2)<10^6, if(n%4==3, c=3-2*I; b=real(d=a^n)%n-(n-imag(d))%n*I, c=3+2*I; b=real(d=a^n)%n+imag(d)%n*I); if(b==c&&!isprime(n), print(n)))
1105
2465
10585
29341
41041
46657
115921
etc [/code](interrupted, took longer then 5 minutes, a function complex_power_mod would be need to make the mod after each iterations, otherwise working with so big numbers is very slow)

Now, all that appear in the list are 1 (mod 4), but there is no reason why 3 (mod 4) numbers won't appear if we go higher. We also can change the complex base, to get some other numbers which "pass". We can see this works right, by removing the "&&!isprime()" call then it prints all primes. For example, with 2+i, there are the same as above, plus few additional: 15841 is one of them.

 LaurV 2012-12-06 07:56

[QUOTE=LaurV;320698]a function complex_power_mod would be need [/QUOTE]

It turned out there is no big deal to implement this. No idea if pari has one already. I made it recursive, if power is even, call the function with power>>1, square, if power is odd multiply, take mod at the end. I put that in a "[B]cIsPrime(b,n)[/B]" function, which will return 1 if n is probable prime base b, with b being a complex number.

The nicer part is that now, a complex number can be one with the imaginary part being zero :razz:. Do you recognize these numbers? (please scroll down into the code section)

[CODE]gp> forstep(n=3,10^6,2, if(cIsPrime([COLOR=Red][B]2[/B][/COLOR],n)&&!isprime(n),print(n)))
341
561
645
1105
1387
1729
1905
2047
2465
2701
2821
3277
4033
4369
4371
*** <break, snip, this is very fast anyhow> ***

gp > forstep(n=3,10^6,2, if(cIsPrime([COLOR=Red]3+2*I[/COLOR],n)&&!isprime(n),print(n)))
1105
2465
10585
29341
41041
46657
*** <break, snip, this is very fast anyhow> ***

// <[B]This is a beautiful one![/B]> :
gp > forstep(n=3,10^6,2, if(cIsPrime([COLOR=Red][B]1+I[/B][/COLOR],n)&&!isprime(n),print(n)))
561
1105
1729
1905
2047
2465
3277
4033
4681
6601
8321
8481
10585
12801
15841
16705
<etc>
[/CODE]

 wsc812 2012-12-06 08:48

is algorithm complexity [TEX]O(log(N))[/TEX] For [TEX]N=4k+3[/TEX]? we may not select base [TEX]a+bi[/TEX], [TEX]a= b[/TEX][COLOR=black] for effectively testing, and calculate [TEX](a+bi)^{N+1}=a^2+b^2 (mod N)[/TEX][/COLOR]