View Single Post 2021-08-01, 13:48 #16 Alberico Lepore   May 2017 ITALY 2·32·29 Posts Code: check=0 i=0 while(i<10) { solve this system sqrt(N/((10+i)/10))=a , ((10+i)/10*a+a-4)/8=x , 2*x*(x+1)-b*(b-1)/2=(N-3)/8 } memorize b(i) C=0 while (check==0){ i=0 while(i<10 && check==0) { h=x-b(i)/2-C // b/2 must be integer , [2*(h-1)*(h-1+1)] < N-3)/8-b(i)/2*(4*x+1-2*(y-1)) <= [2*h*(h+1)] , 2*(x)*(x+1)-y*(y-1)/2=(N-3)/8 while(min_h <= max_h && check==0){ x=h+b/2+C 2*(x)*(x+1)-y*(y-1)/2=(N-3)/8 calculate p p=4*x+1-2*(y-1) if(N mod p ==0 && p!=1 && p!=N){ check=1 break } min_h++ } i++ } C++ } Example N=390644893234047643 , sqrt(N/(15/10))=a , (15/10*a+a-4)/8=x , 2*x*(x+1)-b*(b-1)/2=(N-3)/8 b = 63790420 h=x-(63790420)/2-C , [2*(h-1)*(h-1+1)] < (390644893234047643-3)/8-(63790420)/2*(4*x+1-2*(y-1)) <= [2*h*(h+1)] , 2*(x)*(x+1)-y*(y-1)/2=(390644893234047643-3)/8 per C=-7454 127855236<=h<127855255 -> size range = 19 per h=127855241 , h=x-(63790420)/2-7454 -> x=159757905 the problem is that size range of h is decreasing for C=0 127580838<=h<127584034 -> size range = 3196 for C=3727 127775161<=h<127775188 -> size range =27 an exponential decrease would seem to our advantage ********************************************************************* UPDATE: I tried to solve in x and I noticed that the first valid value is our x = 159757905 if it would always happen the cost of factoring 390644893234047643 would be 7454 * 10 = 74540 Tomorrow morning I will continue with other tests https://www.wolframalpha.com/input/?...%2F8+%2Ch+%2Cy Last fiddled with by Alberico Lepore on 2021-08-01 at 19:00 Reason: UPDATE  