← Complete problem index

PROJECT EULER · #0540

Counting Primitive Pythagorean Triples

Statement only · SolvedOriginal problem ↗

A Pythagorean triple consists of three positive integers a,b and c satisfying a2+b2=c2.
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<cn.
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).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.