1 / X + 1 / Y = 1 / N(阶乘) [英] 1/x + 1/y = 1/N(factorial)

查看:182
本文介绍了1 / X + 1 / Y = 1 / N(阶乘)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在的问题是,如何解决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 &middot; P 2 K 2 &middot; ...&middot; P 的<子>的Ĵ K 的<子>的Ĵ。中的米每一个因素的将有从0到的 K 的<分> 1 要素的 P 的<分> 1 ,0至的 K 2 P 2 的因素,等等。因此,有(1 + K 的<分> 1 )&middot; (1 + K 2 )&middot; ...&middot; (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, 16 = 18 + 124 as being a different pair from 16 = 124 + 18. 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.)

这篇关于1 / X + 1 / Y = 1 / N(阶乘)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆