We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #180: Rational zeros of a function of three variables.

# Project Euler #180: Rational zeros of a function of three variables.

# Project Euler #180: Rational zeros of a function of three variables.

Contest ends in

_{This problem is a programming version of Problem 180 from projecteuler.net}

For any integer , consider the three functions

and their combination

We call a golden triple of order if , and are all rational numbers of the form with and there is (at least) one integer , so that .

Let . Let be the sum of all distinct for all golden triples of order . All the and must be in reduced form.

Find .

**Input Format**

Input contains the only integer which is the order of golden triples.

**Constraints**

**Output Format**

Output the only number which is the answer to the problem.

**Sample Input 0**

```
2
```

**Sample Output 0**

```
1
```

**Explanation 0**

There are no such , and that for , so and you should output .