Triples
Time limit5sMemory limit256 MB
Count triples x<=y<=z<=m with x^j+y^j=z^j for each exponent j from 2 to n and print the total.
- Level
Easy2 of 10
- Topics
- Brute force, Math
- Solved
- No attempts yet
Problem
Two positive integers and are given, with and . For each exponent , define the set of triples
where is the set of nonnegative integers, that is .
Compute the sum :
Here is the number of elements of the set .
Input
The first line contains . The second line contains .
Output
Print the value of .