784. Reciprocal Pairs

Let's call a pair of positive integers p, q (p<q) reciprocal, if there is a positive integer r<p such that r equals both the inverse of p modulo q and the inverse of q modulo p.

For example, (3,5) is one reciprocal pair for r=2. Let F(N) be the total sum of p+q for all reciprocal pairs (p,q) where pN.

F(5)=59 due to these four reciprocal pairs (3,5), (4,11), (5,7) and (5,19). You are also given F(102)=697317.

Find F(2106).

784. 互反数对

我们称数对 (p,q)(p<q) 为互反数对,当且仅当存在一个正整数 r<p,使得 r 既为模 q 意义下 p 的乘法逆,也为模 p 意义下 q 的乘法逆。例如 (3,5) 是一对互反数对,令 r=2 即可。

F(N) 为所有满足 pN 的互反数对 (p,q)p+q 之和。例如 F(5)=59,因为共有 (3,5)(4,11)(5,7)(5,19) 四个满足条件的互反数对。已知:F(102)=697317

F(2106)


这个链接 回到源站。

这个链接 回到详细版题目目录。