1 / X + 1 / Y = 1 / N(阶乘)阶乘

2023-09-11 01:55:35 作者:丶南木离风

现在的问题是,如何解决1 / X + 1 / Y = 1 / N! (N阶乘)。发现满足x和y为N个较大的值的值的数目。

The question is, how to solve 1/x + 1/y = 1/N! (N factorial). Find the number of values that satisfy x and y for large values of N.

我已经解决了N个相对较小的值的问题(任何N!那将放入一个长)。所以,我知道我解决了通过获取的所有除数的问题(N!)^ 2。但是,启动失败时(N!)^ 2不适合长。我也知道我能找到N个全部的约数!加起来因素N中的每个号码的所有主要因素!我所缺少的是我怎么可以使用所有的号码阶乘找到x和y的值。

I've solved the problem for relatively small values of N (any N! that'll fit into a long). So, I know I solve the problem by getting all the divisors of (N!)^2. But that starts failing when (N!)^2 fails to fit into a long. I also know I can find all the divisors of N! by adding up all the prime factors of each number factored in N!. What I am missing is how I can use all the numbers in the factorial to find the x and y values.

编辑:不找答案只是一个或两个提示

Not looking for the "answer" just a hint or two.

推荐答案

这是你的暗示。假设的 M = P 的 1 的 K 的 1 · P 的 2 的 K 的 2 · ...· P 的的Ĵ的 的 K 的的Ĵ的 。中的米每一个因素的将有从0到的 K 的 1 要素的 P 的 1 ,0至的 K 的 2 的 P 的 2 的因素,等等。因此,有(1 + K 的 1 )· (1 + K 的 2 )· ...· (1 + K 的的Ĵ的)可能的约数。

Here is your hint. Suppose that m = p1k1 · p2k2 · ... · pjkj. Every factor of m will have from 0 to k1 factors of p1, 0 to k2 factors of p2, and so on. Thus there are (1 + k1) · (1 + k2) · ... · (1 + kj) possible divisors.

所以,你需要找出的素因子分解的 N 的! 2 。

So you need to figure out the prime factorization of n!2.

请注意,这会算,例如, 1 / 6 = 1 / 8 + 1 / 24 作为一对不同的 1 / 6 = 1 / 24 + 1 / 8 。如果顺序并不重要,加1除以2(2分频是因为一般2除数将导致相同的答案,与加1的不同之处在于除数的 N 的!线索到一对双用本身。)

Note, this will count, for instance, 1⁄6 = 1⁄8 + 1⁄24 as being a different pair from 1⁄6 = 1⁄24 + 1⁄8. If order does not matter, add 1 and divide by 2. (The divide by 2 is because typically 2 divisors will lead to the same answer, with the add 1 for the exception that the divisor n! leads to a pair that pairs with itself.)

 
精彩推荐
图片推荐