eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

An Idea of Mr. A

An Idea of Mr. A

Mr. A proposes to his son the following problem: "Consider two integers \textbf{n_1} and \textbf{n_2} such that \textbf{1} ≤ \textbf{n_1} < \textbf{n_2} ≤ \textbf{10^4}. \includegraphics{https://static.e-olymp.com/content/a9/a95e3a2fa6a4bb21891b266af71619da5c09face.jpg} \includegraphics{https://static.e-olymp.com/content/a0/a01d6fe5baf86fd274dfc5600a30f76cc672dd3c.jpg} Using the function \textbf{p:N^\{*\}→N^\{*\}}, \textbf{p(n)=2^n}, \textbf{n } \textbf{N^\{*\}} (where \textbf{N^\{*\}} is the set of positive integers) we define the set \includegraphics{https://static.e-olymp.com/content/cc/cc0398b87a904999bdf492c354bee4a8bfa52551.jpg} We also define a set of pairs as follows: \includegraphics{https://static.e-olymp.com/content/63/63d0381132342edaeb4d42623b9ccc845eb09bb3.jpg} Consider the formula: \includegraphics{https://static.e-olymp.com/content/50/508dbcd5ef58d0e6680a48c078349a2663ff3f30.jpg} where \textbf{gcd(m_1,m_2)} is the greatest common divisor of \textbf{m_1} and \textbf{m_2}. The problem asks to find the number \textbf{R(n_1,n_2)}." Solve the problem proposed by Mr. A. \InputFile The input file consists of a single line having the values for \textbf{n_1} and \textbf{n_2}, separated by exactly one space. \OutputFile For each test, the result will be written to standard output and consists of the value of \textbf{R(n_1,n_2)}.
Лимит времени 0.5 секунд
Лимит использования памяти 256 MiB
Входные данные #1
1 34
Выходные данные #1
561
Источник ACM SEERC 2013, SouthEastern European Region, October, 12/10/2013, Vinnica & Bucharest