View Single Post
Old 2008-12-03, 15:26   #3
alpertron's Avatar
Aug 2002
Buenos Aires, Argentina

2·17·43 Posts

I tested the first five million values of m and it appears to work. This is the program in UBASIC, noticing that the point "a" is equivalent to m=1 (mod 20). Nothing is printed, so it is OK.

   10   for M=1 to 5000000
   20   if 2*M+1<>nxtprm(2*M) or 10*M+1<>nxtprm(10*M) or 16*M+1<>nxtprm(16*M) then 60
   30   A=2*M+1:B=10*M+1:C=16*M+1:D=A*B*C
   40   if (D-1)@(A-1)<>0 or (D-1)@(B-1)<>0 or (D-1)@(C-1)<>0 then K=0 else K=1
   50   if (M@20=1 and K=0) or (M@20<>1 and K=1) then print M,(2*M+1)*(10*M+1)*(16*M+1)
   60   next M

Last fiddled with by alpertron on 2008-12-03 at 15:44 Reason: Added program in UBASIC
alpertron is offline   Reply With Quote