20221112, 16:54  #1 
Feb 2012
Prague, Czech Republ
3×67 Posts 
Another failing 1liner
Code:
? forprime(p=3,37,m=1<<p1;n=1<<(p2)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. ? 
20221112, 17:28  #2 
"Forget I exist"
Jul 2009
Dartmouth NS
2×3×23×61 Posts 

20221112, 18:26  #3 
Feb 2012
Prague, Czech Republ
3×67 Posts 
AFAICT \(p2\) 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<<p1;n=1<<(p1)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. ? 
20221112, 21:15  #4 
"Chereztynnoguzakidai"
Oct 2022
Ukraine, near Kyiv.
53 Posts 
in the Hell, the Satanmachine 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 1liners, I rotated it, I know... 
20221112, 21:34  #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^) 
20221114, 07:24  #6 
Feb 2012
Prague, Czech Republ
3×67 Posts 
it can be "fixed"
\(M_{p2}^{M_{p1}} \equiv 1 \pmod {M_p}\)
Code:
? m(p)=1<<p1 %1 = (p)>1<<p1 ? forprime(p=3,4423,if(Mod(m(p2),m(p))^m(p1)==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  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
ASSERT_ALWAYS failing  mgeisert  GMPECM  2  20220512 08:45 
Msieve failing  pinhodecarlos  Msieve  7  20181109 21:54 
mulmod failing  ATH  Programming  4  20170608 22:22 
Worker 1 Keeps failing  zenzu88  Software  2  20120410 15:16 
Failing Torture Test..  jugbugs  Hardware  12  20040325 02:37 