找回密码
 欢迎注册
楼主: liangbch

[擂台] 来个简单的,求n以内因数最多的数

[复制链接]
发表于 2008-12-11 15:43:57 | 显示全部楼层
10个因子的 129600 9 5 4 2 2 2 1 1 1 1
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:30:49 | 显示全部楼层
11个因子的 155520 8 4 3 2 2 2 1 1 1 1 1
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:43:31 | 显示全部楼层
7 4 2 2 1 1 1 1 1 1 1 1 1 factors : 184320
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:49:36 | 显示全部楼层
12的 168960 10 4 3 2 1 1 1 1 1 1 1 1
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:52:02 | 显示全部楼层
13的 184320 7 4 2 2 1 1 1 1 1 1 1 1 1
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:54:13 | 显示全部楼层
14个因子的 153600 4 4 2 1 1 1 1 1 1 1 1 1 1 1
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:56:37 | 显示全部楼层
因此该问题答案 最多有13个不同素因子 184320个因子 2^7*3^4*5^2*7^2*11*13*17*19*23*29*31*37*41 = 18401055938125660800
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 16:58:05 | 显示全部楼层
C 测试程序, 适合于8个以上因子 ================================= #include #include #include int main(void) { int a,b,c,d,e,f,g,h,i,j,k, l, m, n; double l2,l3,l5,l7,l11,l13,l17,l19,l23,l29,l31,l37, l41, l43; double t1, t2, t3; int max, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, s; int mm1, mm2, mm3; l2 = 1.0; l3 = log(3) / log(2); l5 = log(5) / log(2); l7 = log(7) / log(2); l11 = log(11) / log(2); l13 = log(13) / log(2); l17 = log(17) / log(2); l19 = log(19) / log(2); l23 = log(23) / log(2); l29 = log(29) / log(2); l31 = log(31) / log(2); l37 = log(37) / log(2); l41 = log(41) / log(2); l43 = log(43) / log(2); max = 0; s = 0; m1 = m2 = m3 = m4 = 0; m5 = m6 = m7 = m8 = 0; m9 = m10 = m11 = m12 = 0; m13 = m14 = 0; for (a = 1; a <= 10; a++) for (b = 1; b <= 8; b++) for (c = 1; c <= 6; c++) for (d = 1; d <= 4; d++) for (e = 1; e <= 4; e++) for (f = 1; f <= 4; f++) for (g = 1; g <= 4; g++) for (h = 1; h <= 3; h++) for (i = 1; i <= 3; i++) for (j = 1; j <= 3; j++) for (k = 1; k <= 3; k++) for (l = 1; l <= 2; l++) for (m = 1; m <= 2; m++) for (n = 1; n <= 2; n++) { t1 = a * l2 + b * l3 + c * l5 + d * l7; t2 = e * l11 + f * l13 + g * l17 + h * l19; t3 = i * l23 + j * l29 + k * l31 + l * l37 + m * l41 + n * l43; s ++; //printf("%f ", t1 + t2 + t3); if ((t1 + t2 + t3) <= 64.0) { mm1 = (a+1)*(b+1)*(c+1)*(d+1); mm2 = (e+1)*(f+1)*(g+1)*(h+1); mm3 = (i+1)*(j+1)*(k+1)*(l+1)*(m+1)*(n+1); // printf("%d: %d", s, mm1 + mm2 + mm3); if (mm1*mm2*mm3 > max) { max = mm1 * mm2 * mm3; m1 = a; m2 = b; m3 = c; m4 = d; m5 = e; m6 = f; m7 = g;m8 = h; m9 = i; m10 = j; m11 = k; m12 = l; m13 = m; m14 = n; } } } printf("Search %d\n", s); printf("14: %d %d %d %d %d %d %d ", max, m1, m2, m3, m4, m5, m6); printf("%d %d %d %d %d %d %d %d", m7, m8, m9, m10, m11, m12, m13, m14); }
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 17:01:51 | 显示全部楼层
Media2005啊 不要去掉帖子修改时间 好不好啊 呵呵
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2008-12-11 17:14:04 | 显示全部楼层
对不起,13# 可能是我误去的。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-11-24 12:20 , Processed in 0.037916 second(s), 14 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表