No.843 Triple Primes
問題文最終更新日: 2019-03-18 23:10:42
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 216
(順位表)
の他の問題:
Problem Statement
Find the number of tuples $(p,q,r)$ of primes not exceeding $N$ that satisfy $p + q = r^2$.
Input
$N$
Constraints
- All inputs are integers.
- $1 \le N \le 5 \times 10^5$
Output
Output the answer on a single line.
Sample
Sample 1
Input
10
Output
3
$(p,q,r) = (2,2,2),(7,2,3),(2,7,3)$ satisfy the condition.
Sample 2
Input
500000
Output
81
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Tlapesium