Tracks
/
Julia
/
Exercises
/
Pythagorean Triplet

# Pythagorean Triplet

Medium

## Introduction

Your friend Ashley enjoys art inspired by mathematics and you would like to make them a cute birthday card. You have seen the variety of patterns (rays, parabolas, partial symmetry, oh my) in this plot of pythagorean triplets and think you could make something neat with them.

The next step on your creative journey is to find some pythagorean triplets!

## Instructions

A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,

``````aÂ² + bÂ² = cÂ²
``````

and such that,

``````a < b < c
``````

For example,

``````3Â² + 4Â² = 5Â².
``````

Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`.

For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`.

### Source

Problem 9 at Project Euler
Edit via GitHub

### Ready to start Pythagorean Triplet?

Sign up to Exercism to learn and master Julia with 59 exercises, and real human mentoring, all for free.