Theory: For larger n, imagine choosing an arbitrary pair of people to shake hands. You’ve now divided the circle into two smaller circles (one of which may have 0 people in it). The number of ways you can arrange the rest of the people is the product of the answers for the two smaller circles.
Category: Algorithm
960
Gaussian Prime Integer Problem Theory: First we should know that the multiple of two lengths is the length of the original one. For example, (4,3) has a length of 5, so if we can break (4,3) down into A & B, length(A) * length(B) is also 5. Next we’ll iterate through all possible combinations (lengths.)
10179
Euler function (Phi) Problem How to Solve: if n is prime then number of relative prime from 1 upto n is n-1. This is represented as phi function. if n and m relatively prime then phi(mn)=phi(n)*phi(m). (proof given bellow as matrix representation of the 1 from mn) The problem was solved by taking the number