Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
Go thru this http://stackoverflow.com/questions/8650827/sample-testcase-for-interviewstreet-equationsyou should be able to solve the question On Tue, Jun 26, 2012 at 1:58 AM, prakash y yprakash@gmail.com wrote: @Vishal, If the output should be the total no.of pairs, then i think there are infinite no.of such pairs. but not sure. Can someone provide me the link to the actual problem and some analysis of solution? Thanks, ~Prakash. On Mon, Jun 25, 2012 at 9:45 PM, Kumar Vishal kumar...@gmail.com wrote: Sorry My Mistake *Number of pairs should be OUTPUT...* On Mon, Jun 25, 2012 at 8:49 PM, prakash y yprakash@gmail.comwrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
@Kishore in below link no one deals with how to calculate or escape calculating factorial (n) On Tue, Jun 26, 2012 at 12:28 PM, Kishore kkishoreya...@gmail.com wrote: Go thru this http://stackoverflow.com/questions/8650827/sample-testcase-for-interviewstreet-equationsyou should be able to solve the question On Tue, Jun 26, 2012 at 1:58 AM, prakash y yprakash@gmail.com wrote: @Vishal, If the output should be the total no.of pairs, then i think there are infinite no.of such pairs. but not sure. Can someone provide me the link to the actual problem and some analysis of solution? Thanks, ~Prakash. On Mon, Jun 25, 2012 at 9:45 PM, Kumar Vishal kumar...@gmail.com wrote: Sorry My Mistake *Number of pairs should be OUTPUT...* On Mon, Jun 25, 2012 at 8:49 PM, prakash y yprakash@gmail.comwrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
@ SAM Thanks On Tue, Jun 26, 2012 at 8:21 PM, SAMM somnath.nit...@gmail.com wrote: 1 /x + 1/y = 1/(n!) * Consider N = n! , * *The Equation becoz :-* 1/x + 1/y = 1/N or (x+y)/xy = 1/N or N( x + y ) = xy *Changing sides we get :-* xy - N(x+y) = 0 *Adding N^2 on both sides we get :-* xy - N( x + y) + N^2 = N^2 or xy - Nx - Ny + N^2 = N^2 or x(y - N) - N (y - N ) = N^2 or (x - N) (y - N) = N^2 From this equation we find that we can find the number of solution equal to the total number of divisors of (N ^ 2) .or ( n! ^2) . So you need to find the divisors of the square of the n! which can be done by finding the primes factor of the n! For example :- n! = p1^a * p2^b * pn^x *[ p1 , p2 .. pn are the prime factors ]* (n1 ^ 2) = p1^2a * p2^2b * pn^2x So the number of divisors are *(2a + 1) * (2b +1 ) * (2x + 1) *.. You need to calculate this ... No need to calculate the factorial just need to check for the prime factor from (2 to n ) . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
This is from interviewstreet named with equations On Mon, Jun 25, 2012 at 11:19 AM, prakash y yprakash@gmail.com wrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
@Prakash The Pattern given by u is because factorial (n) is always *even *so u can always divide them in two equal part . what about 1/6= 1/8 + 1/24( 6 = factorial (3)) On Mon, Jun 25, 2012 at 11:24 PM, Kishore kkishoreya...@gmail.com wrote: This is from interviewstreet named with equations On Mon, Jun 25, 2012 at 11:19 AM, prakash y yprakash@gmail.comwrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
Sorry My Mistake *Number of pairs should be OUTPUT...* On Mon, Jun 25, 2012 at 8:49 PM, prakash y yprakash@gmail.com wrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Find the Pair of X,Y [ 1/x + 1/y = 1/N! ]
@Vishal, If the output should be the total no.of pairs, then i think there are infinite no.of such pairs. but not sure. Can someone provide me the link to the actual problem and some analysis of solution? Thanks, ~Prakash. On Mon, Jun 25, 2012 at 9:45 PM, Kumar Vishal kumar...@gmail.com wrote: Sorry My Mistake *Number of pairs should be OUTPUT...* On Mon, Jun 25, 2012 at 8:49 PM, prakash y yprakash@gmail.com wrote: 2! - x=y=4 3! - x=y=12 4! - x=y=48 5! - x=y=240 6! - x=y=1440 I don't have proof to prove x = y always. But if x=y, then the answer should be x=y=2*n! On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote: Few Months back I found the problem on Code Sprint 1/x + 1/y = 1/N! (N factorial). For large value of N we have to find the par of (X,Y) which satisfy the equation my sol was slow , can any pleas help me . Thanks Kumar Vishal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/PeqVSr7OlFsJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Vishal _ *http://wethecommonpeople.wordpress.com/ * *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/ * _ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.