Psychology and Mental Health Forum


https://www.psychforums.com/blog/highdimensionman/i%CA%B9ve_made_some_improvements_b-8236_sid-b60d179b9cdc51d656cda96f0aa6f86f.html

Author:  highdimensionman [ Sun Apr 05, 2015 5:16 am ]
Blog Subject:  I've made some Improvements

I think I've finally found a way to deduce if a number is a prime quick for large primes.
The code is now tidied up but not compilable yet. Currently I'm taking my studies into FASM and intend to bring my maths down optimal in assembly.

heres the test try it yourself. The cheapest way to buy mathematica is with a Raspberry Pi thats what I'm using at the moment.

PrimeQu[cex_] :=
Catch[ Module[ {zcv = PowerMod[2, cex, cex] - 2, zcv2 = JacobiSymbol[ FromDigits[Append[Table[1, {xvc, Floor[Log[2, cex]] + 1}], 0], 3] FromDigits[ Append[Table[1, {xvc, Floor[Log[3, cex]] + 1}], 0], 2], cex], zcv3 = JacobiSymbol[ FromDigits[Append[Table[1, {xvc, Floor[Log[2, cex]] + 1}], 0], 5] FromDigits[ Append[Table[1, {xvc, Floor[Log[5, cex]] + 1}], 0], 2], cex], Var25, Var26, ced = cex }, Var25 = If[GCD[ced, 2] == 2 || GCD[ced, 3] == 3 || GCD[ced, 5] == 5, If[ced == 2 || ced == 3 || ced == 5, 1, 2], 2]; Var26 = If[zcv == 0 && Abs[zcv2] == 1 && Abs[zcv3] == 1, 1, 2]; If[Var25 == 1 && Var26 == 1, Throw["True"], Throw["False"]]; ]];

All times are UTC

Powered by phpBB © 2002, 2006 phpBB Group
www.phpbb.com