Sanggeun's Idea
Time limit2sMemory limit128 MB
Compute the sum of gcds over all pairs of values 2^(2^n)+1 for n from n1 to n2.
- Level
Medium7 of 10
- Topics
- Number theory, Combinatorics
- Solved
- No attempts yet
Problem
Sanggeun gave his son the following problem.
Two integers and satisfy . Let be the set of positive integers and define by for every . This function defines the set .
The set of pairs built from the elements of is defined as well.
Now define the value
where is the greatest common divisor of and .
Given and , write a program that computes .
Input
The first line contains two integers and separated by a space. ()
Output
Print the value of on the first line.