Problem 540
Counting primitive Pythagorean triples
A Pythagorean triple consists of three positive integers $a$, $b$ and $c$ satsifying $a^2+b^2=c^2$.
The triple is called primitive if $a$, $b$ and $c$ are relatively prime.
Let P($n$) be the number of primitive Pythagorean triples with $a<b<c \le n$.
For example P(20) = 3, since there are three triples: (3,4,5), (5,12,13) and (8,15,17).
You are given that P(106) = 159139.
Find P(3141592653589793).
本原毕达哥拉斯三元组计数
毕达哥拉斯三元组包含有三个整数$a$、$b$和$c$,满足等式$a^2+b^2=c^2$。
当$a$、$b$和$c$互素时,这个三元组被称为本原的。
记P($n$)是满足$a<b<c \le n$的本原毕达哥拉斯三元组的数目。
例如P(20) = 3,这三个三元组是:(3,4,5),(5,12,13)和(8,15,17)。
已知P(106) = 159139。
求P(3141592653589793)。