0%

Problem 784


Problem 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).


模倒数对

对于正整数pq(满足p<q),若存在正整数r<p使得r同时是p同余q的逆元和q同余p的逆元,则称这两个正整数互为模倒数

例如,(3,5)是一组模倒数对,其对应的r=2

对所有满足pN的模倒数对(p,q),记F(N)为所有p+q之和。

例如,F(5)=59,因为共有四组模倒数对(3,5)(4,11)(5,7)(5,19)

已知F(102)=697317

F(2106)


Gitalking ...