Problem 183
Maximum product of parts
Let N be a positive integer and let N be split into k equal parts, r = N/k, so that N = r + r + … + r.
Let P be the product of these parts, P = r × r × … × r = rk.
For example, if 11 is split into five equal parts, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2, then P = 2.25 = 51.53632.
Let M(N) = Pmax for a given value of N.
It turns out that the maximum for N = 11 is found by splitting eleven into four equal parts which leads to Pmax = (11/4)4; that is, M(11) = 14641/256 = 57.19140625, which is a terminating decimal.
However, for N = 8 the maximum is achieved by splitting it into three equal parts, so M(8) = 512/27, which is a non-terminating decimal.
Let D(N) = N if M(N) is a non-terminating decimal and D(N) = -N if M(N) is a terminating decimal.
For example, ΣD(N) for 5 ≤ N ≤ 100 is 2438.
Find ΣD(N) for 5 ≤ N ≤ 10000.
最大拆分乘积
N是一个正整数,将N拆分成k个相等的部分,记r = N/k,也即N = r + r + … + r。
记P是这些拆分的乘积,也即P = r × r × … × r = rk。
例如,将11拆分成5个相等的部分,11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2,那么P = 2.25 = 51.53632。
对于给定的N,记M(N) = Pmax。
计算可得,N = 11时,这个最大值是在将其拆分成四等份时得到的,此时Pmax = (11/4)4,也就是说M(11) = 14641/256 = 57.19140625,这是一个有限小数。
然而,对于N = 8,这个最大值是在将其拆分成三等份时得到的,此时M(8) = 512/27,不是有限小数。
若M(N)不是有限小数,记D(N) = N,反之记D(N) = -N。
例如,对于5 ≤ N ≤ 100,ΣD(N) 为2438。
对于5 ≤ N ≤ 10000,求ΣD(N)。