**Zumkeller numbers** are the set of numbers whose divisors can be partitioned into two disjoint sets that sum to the same value. The first few zumkeller numbers are **6, 12, 20, 24, 28, 30, 40, 42, 48, 54, …**.

In this article, we will find the N^{th} Zumkeller number.

**Find the N ^{th} Zumkeller Number:** Given a number

**N**, the task is to find the N

^{th}Zumkeller number.

**Examples:**

Input:N = 2

Output:12

Explanation:

The second Zumkeller number is 12.

Input:N = 5

Output:28

**Approach:** The following steps are followed to compute the answer.

- Get the number N.
- Iterate over the loop starting from i = 1 until Nth Zumkeller number is found.
- Check the number ‘i’ is a zumkeller number or not.
- If yes, then repeat the above step for i+1 and increment the counter.
- If no, then repeat the above step for i+1 without incrementing the counter.
- Finally, when the counter is equal to the number N, that number is the N-th zumkeller number. Print the value of ‘i’ and break the loop.

Below is the implementation of the above approach:

## Python3

`# Python program to find the ` `# N-th Zumkeller number ` ` ` `# Function to find all the ` `# divisiors ` `def` `Divisors(n) : ` ` ` `l ` `=` `[] ` ` ` `i ` `=` `1` ` ` `while` `i <` `=` `n : ` ` ` `if` `(n ` `%` `i ` `=` `=` `0` `) : ` ` ` `l.append(i) ` ` ` `i ` `=` `i ` `+` `1` ` ` `return` `l ` ` ` `# Function to check if the sum ` `# of the subset of divisors is ` `# equal to sum / 2 or not ` `def` `PowerSet(arr, n, s): ` ` ` ` ` `# List to find all the ` ` ` `# subsets of the given set. ` ` ` `# Any repeated subset is ` ` ` `# considered only ` ` ` `# once in the output ` ` ` `_list ` `=` `[] ` ` ` ` ` `# Run a counter i ` ` ` `for` `i ` `in` `range` `(` `2` `*` `*` `n): ` ` ` `subset ` `=` `"" ` ` ` ` ` `# Consider each element ` ` ` `# in the set ` ` ` `for` `j ` `in` `range` `(n): ` ` ` ` ` `# Check if j-th bit in ` ` ` `# the i is set. ` ` ` `# If the bit is set, ` ` ` `# we consider ` ` ` `# j-th element from set ` ` ` `if` `(i & (` `1` `<< j)) !` `=` `0` `: ` ` ` `subset ` `+` `=` `str` `(arr[j]) ` `+` `"|"` ` ` ` ` `# Check if the subset is ` ` ` `# encountered for the first time. ` ` ` `if` `subset ` `not` `in` `_list ` `and` `len` `(subset) > ` `0` `: ` ` ` `_list.append(subset) ` ` ` ` ` `# Consider every subset ` ` ` `for` `subset ` `in` `_list: ` ` ` `sum` `=` `0` ` ` ` ` `# Split the subset and ` ` ` `# sum of its elements ` ` ` `arr ` `=` `subset.split(` `'|'` `) ` ` ` `for` `string ` `in` `arr[:` `-` `1` `]: ` ` ` `sum` `+` `=` `int` `(string) ` ` ` ` ` `# If the sum is equal ` ` ` `# to S ` ` ` `if` `sum` `=` `=` `s: ` ` ` `return` `True` ` ` ` ` `return` `False` ` ` `# Function to check if a number ` `# is a Zumkeller number ` `def` `isZumkeller(n): ` ` ` ` ` `# To find all the divisors ` ` ` `# of a number N ` ` ` `d ` `=` `Divisors(n) ` ` ` ` ` `# Finding the sum of ` ` ` `# all the divisors ` ` ` `s ` `=` `sum` `(d) ` ` ` ` ` `# Check for the condition that ` ` ` `# sum must be even and the ` ` ` `# maximum divisor is less than ` ` ` `# or equal to sum / 2. ` ` ` `# If the sum is odd and the ` ` ` `# maximum divisor is greater than ` ` ` `# sum / 2, then it is not possible ` ` ` `# to divide the divisors into ` ` ` `# two sets ` ` ` `if` `not` `s ` `%` `2` `and` `max` `(d) <` `=` `s ` `/` `2` `: ` ` ` ` ` `# For all the subsets of ` ` ` `# the divisors ` ` ` `if` `PowerSet(d, ` `len` `(d), s ` `/` `2` `) : ` ` ` `return` `True` ` ` ` ` `return` `False` ` ` ` ` `# Function to print N-th ` `# Zumkeller number ` `def` `printZumkellers(N): ` ` ` `val ` `=` `0` ` ` `ans ` `=` `0` ` ` ` ` `# Iterating through all ` ` ` `# the numbers ` ` ` `for` `n ` `in` `range` `(` `1` `, ` `10` `*` `*` `5` `): ` ` ` ` ` `# Check if n is a ` ` ` `# Zumkeller number ` ` ` `if` `isZumkeller(n): ` ` ` `ans ` `=` `n ` ` ` `val ` `+` `=` `1` ` ` ` ` `# Check if N-th Zumkeller number ` ` ` `# is obtained or not ` ` ` `if` `val >` `=` `N: ` ` ` `break` ` ` ` ` `print` `(ans) ` ` ` `# Driver code ` `if` `__name__ ` `=` `=` `'__main__'` `: ` ` ` ` ` `N ` `=` `4` ` ` ` ` `printZumkellers(N) ` |

*chevron_right*

*filter_none*

**Output:**

24

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Nth term where K+1th term is product of Kth term with difference of max and min digit of Kth term
- Find the Nth term of the series where each term f[i] = f[i - 1] - f[i - 2]
- Find Nth term of the series where each term differs by 6 and 2 alternately
- Nth term of a sequence formed by sum of current term with product of its largest and smallest digit
- First term from given Nth term of the equation F(N) = (2 * F(N - 1)) % 10^9 + 7
- Nth term of given recurrence relation having each term equal to the product of previous K terms
- Program to print tetrahedral numbers upto Nth term
- Program to print pentatope numbers upto Nth term
- Program to find Nth term in the given Series
- Find nth term of the Dragon Curve Sequence
- Program to find the Nth term of the series 3, 7, 13, 21, 31.....
- Program to find Nth term of series 1, 3, 12, 60, 360…
- Program to find the Nth term of series -1, 2, 11, 26, 47......
- Program to find Nth term in the series 0, 0, 2, 1, 4, 2, 6, 3, 8,...
- Program to find Nth term of series 9, 23, 45, 75, 113...
- Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,…
- Find Nth term of the series 5, 13, 25, 41, 61...
- Program to find the Nth term of the series 3, 20, 63, 144, 230, ……
- Program to find the Nth term of series 5, 10, 17, 26, 37, 50, 65, 82, ...
- Program to find the Nth term of series 0, 4, 14, 30, 51, 80, 114, 154, 200, ...

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.