|
|
|
It proves N must even, that is N=2K. One can also easily proves K must be even too, that is N=4k. Now from the general formula, N=ac*(c-a+1)/(c-a) and N/a (or N/c) must be integer, c must have c-a as its factor, that is, c=i*(c-a) where i>=1. Put m=c-a and take a few simple steps, one finds the more meaningful formula, N=i*(i+1)*m*(m+1). Here i is integer larger than 1 and m=c-a. Keep in mind, N=c*d and c<=d and a>=1, so m(max)<=N**(0.5)-1. Based on this formula, it is easy to see the minimum requirement mentioned before, that is, N=(2**x)(2y+1) where x>=2 and 2y+1 is not prime. To calculate the total valid N under 10**6, loop m from 1 to m(max) and for each m loop i from 1 to current m (to avoid duplicate N). The only thing left is if there exists any duplicate in such nested loop calculation (after excluding i/m exchange effect). Now it may be worth to a program based on the new formula and check wether or not duplicate still exists, and why if not. I am not sure now if it is possible to get the total valid count without running the program. But at least it becomes simpler and quicker using the new formula. |
|