![]() |
![]() |
#1 |
Feb 2012
Prague, Czech Republ
3×67 Posts |
![]() Code:
? forprime(p=3,37,m=1<<p-1;n=1<<(p-2)-1;for(i=1,n,if(issquare(n),print(p);break);n+=m)) 3 5 7 13 17 19 31 37 ? ## *** last result: cpu time 1min, 32,968 ms, real time 1min, 32,988 ms. ? |
![]() |
![]() |
![]() |
#2 |
"Forget I exist"
Jul 2009
Dartmouth NS
2·3·23·61 Posts |
![]() |
![]() |
![]() |
![]() |
#3 |
Feb 2012
Prague, Czech Republ
3·67 Posts |
![]()
AFAICT \(p-2\) is correct. It's about solving the old \(x^2+x+1=0 \pmod {m_p}\) again. (Completing the square produces \(n\) on the RHS.)
? forprime(p=3,31,print(p);m=1<<p-1;n=1<<(p-1)-1;for(i=1,n,if(issquare(n),print(p);break);n+=m)) 3 5 7 11 13 17 19 23 29 31 ? ## *** last result: cpu time 4min, 35,941 ms, real time 4min, 36,209 ms. ? |
![]() |
![]() |
![]() |
#4 |
"Chereztynnoguzakidai"
Oct 2022
Ukraine, near Kyiv.
53 Posts |
![]()
in the Hell, the Satan-machine exist, for coders (severe cases)
one rotation by right or left arm, the one step of cycle gone, all steps - you are free. Be careful with 1-liners, I rotated it, I know... |
![]() |
![]() |
![]() |
#5 |
If I May
"Chris Halsall"
Sep 2002
Barbados
3×5×739 Posts |
![]()
I was always taught to simply manage the situation. As best as one can.
Read deeply. Use critical thought. Use the scientific method. Question everything; including oneself. Understand the concept of deliberate noise meant to distract. Have thick skin. It's OK to be incorrect. It's also OK to be correct when everyone else thinks you are incorrect. If I may... I will never be able to thank my teachers enough. We are all students. 8^) |
![]() |
![]() |
![]() |
#6 |
Feb 2012
Prague, Czech Republ
3118 Posts |
![]()
\(M_{p-2}^{M_{p-1}} \equiv 1 \pmod {M_p}\)
Code:
? m(p)=1<<p-1 %1 = (p)->1<<p-1 ? forprime(p=3,4423,if(Mod(m(p-2),m(p))^m(p-1)==1,print(p))) 3 5 7 13 17 19 31 61 89 107 127 521 607 1279 2203 2281 3217 4253 4423 ? ## *** last result: cpu time 3,518 ms, real time 3,519 ms. ? |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ASSERT_ALWAYS failing | mgeisert | GMP-ECM | 2 | 2022-05-12 08:45 |
Msieve failing | pinhodecarlos | Msieve | 7 | 2018-11-09 21:54 |
mulmod failing | ATH | Programming | 4 | 2017-06-08 22:22 |
Worker 1 Keeps failing | zenzu88 | Software | 2 | 2012-04-10 15:16 |
Failing Torture Test.. | jugbugs | Hardware | 12 | 2004-03-25 02:37 |