![]() |
|
|
#1 |
|
Feb 2018
9610 Posts |
whats is a fast algorithm for compute znorder(Mod(2,p)).
for p prime but big. Last fiddled with by JM Montolio A on 2018-03-07 at 11:45 |
|
|
|
|
|
#2 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
|
|
|
|
|
|
#3 |
|
Feb 2018
25×3 Posts |
You never sleeps ?
|
|
|
|
|
|
#4 | |
|
Aug 2006
3·1,993 Posts |
Quote:
For example, let's try to find the order of 2 mod 101. m = 100 = 2^2 * 5^2, so we know that 2^100 = 1 mod 101. 2^(100/2) mod 101 is 100 which is not 1, so skip 2. 2^(100/5) = 95 which is not 1, so skip 5, and we're done: the order is 100. Let's try 103. m = 102 = 2 * 3 * 17. 2^(102/2) = 1 mod 103, so m becomes 102/2 = 51. We don't have any more 2s though so we'll go on to 3. 2^(51/3) = 56 mod 103 which is not 1, and 2^(51/17) = 8 mod 103 which is also not 1, so we're done: the order of 2 mod 103 is 51. |
|
|
|
|
|
|
#6 |
|
Apr 2019
5·41 Posts |
Um, if p is prime, isn't the answer always p-1?
edit: nevermind, i'm obviously confused Last fiddled with by hansl on 2019-06-12 at 01:50 |
|
|
|
|
|
#7 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#8 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
22×7×53 Posts |
Quote:
Code:
res_i=2^((p-1)/q^i) mod p for i=e,e-1,..1,0 Multiply these primepowers to get the order. Note that you really need some intelligence here also, because there could be more than polynomial number of divisors of p-1. |
|
|
|
|
|
|
#9 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
100101000001012 Posts |
|
|
|
|
|
|
#10 | |
|
Feb 2017
Nowhere
4,643 Posts |
Quote:
As is well known (supplement to the quadratic reciprocity law), znorder(Mod(2,p)) divides (p-1)/2 if p == 1 or 7 (mod 8), but not otherwise. Since 101 == 5 (mod 8) we know that znorder(Mod(2,101)) does not divide 100/2 = 50. Since 103 = 7 (mod 8) we know that znorder(Mod(2,103)) does divide 102/2 = 51. Alas, the classical criterion of when znorderMod(2,p)) divides (p-1)/4 when 8 divides p-1 [p = x^2 + 64*y^2] likely takes longer to decide than whether Mod(2,p)^((p-1)/4) == Mod(1,p). Likewise, the classical criterion for whether znorder(Mod(2,p)) divides (p-1)/3 when 3 divides p-1 [p = x^2 + 27*y^2] is likely also slower than computing Mod(2,p)^(p-1)/3 when 3 divides p-1. |
|
|
|
|
|
|
#11 |
|
Aug 2006
3×1,993 Posts |
We’re not disagreeing here of course: the factorization takes up asymptotically all the time (in the worst/average case), but for me the heart of the problem is what I described in my post, and the factorization is a (difficult) subproblem that must be resolved before moving on to that core part.
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Do normal adults give themselves an allowance? (...to fast or not to fast - there is no question!) | jasong | jasong | 35 | 2016-12-11 00:57 |
| Whats the next prime? | Dougal | Puzzles | 5 | 2009-08-23 20:16 |
| Whats the best stress test settings for RAM stability? | xtreme2k | Hardware | 6 | 2007-03-28 20:38 |
| Whats going on in the background | ltd | Prime Sierpinski Project | 2 | 2006-12-26 09:40 |
| Whats the worst (harshest scenario) for torture test? | xtreme2k | Hardware | 9 | 2004-07-14 18:41 |