Skip to content

Commit 28ff34b

Browse files
authored
Republish Pythagorean Triplet because of missing instructions. (#414)
* Republish Pythagorean Triplet because of missing instructions. * Changed slug and uuid to the previous ones. * Renamed exercise's directory. * Changed modules' names and edited config of the exercise. * Added new contributor.
1 parent ae0e96c commit 28ff34b

File tree

5 files changed

+80
-2
lines changed

5 files changed

+80
-2
lines changed

config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@
753753
},
754754
{
755755
"slug": "pythagorean-triplets",
756-
"name": "pythagorean-triplets",
756+
"name": "Pythagorean Triplet",
757757
"uuid": "630a11f5-e640-4e4d-af01-30f3bbcf495c",
758758
"practices": [],
759759
"prerequisites": [],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Description
2+
3+
A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,
4+
5+
```text
6+
a² + b² = c²
7+
```
8+
9+
and such that,
10+
11+
```text
12+
a < b < c
13+
```
14+
15+
For example,
16+
17+
```text
18+
3² + 4² = 5².
19+
```
20+
21+
Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`.
22+
23+
For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Introduction
2+
3+
You are an accomplished problem-solver, known for your ability to tackle the most challenging mathematical puzzles.
4+
One evening, you receive an urgent letter from an inventor called the Triangle Tinkerer, who is working on a groundbreaking new project.
5+
The letter reads:
6+
7+
> Dear Mathematician,
8+
>
9+
> I need your help.
10+
> I am designing a device that relies on the unique properties of Pythagorean triplets — sets of three integers that satisfy the equation a² + b² = c².
11+
> This device will revolutionize navigation, but for it to work, I must program it with every possible triplet where the sum of a, b, and c equals a specific number, N.
12+
> Calculating these triplets by hand would take me years, but I hear you are more than up to the task.
13+
>
14+
> Time is of the essence.
15+
> The future of my invention — and perhaps even the future of mathematical innovation — rests on your ability to solve this problem.
16+
17+
Motivated by the importance of the task, you set out to find all Pythagorean triplets that satisfy the condition.
18+
Your work could have far-reaching implications, unlocking new possibilities in science and engineering.
19+
Can you rise to the challenge and make history?

exercises/practice/pythagorean-triplets/.meta/config.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"authors": ["blakelewis"],
3+
"contributors": [
4+
"SimaDovakin"
5+
],
36
"files": {
47
"solution": [
58
"pythagorean-triplets.rkt"
@@ -11,5 +14,7 @@
1114
".meta/example.rkt"
1215
]
1316
},
14-
"blurb": "Find Pythagorean triplets with a given sum"
17+
"blurb": "Given an integer N, find all Pythagorean triplets for which a + b + c = N.",
18+
"source": "A variation of Problem 9 from Project Euler",
19+
"source_url": "https://projecteuler.net/problem=9"
1520
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
11+
12+
[a19de65d-35b8-4480-b1af-371d9541e706]
13+
description = "triplets whose sum is 12"
14+
15+
[48b21332-0a3d-43b2-9a52-90b2a6e5c9f5]
16+
description = "triplets whose sum is 108"
17+
18+
[dffc1266-418e-4daa-81af-54c3e95c3bb5]
19+
description = "triplets whose sum is 1000"
20+
21+
[5f86a2d4-6383-4cce-93a5-e4489e79b186]
22+
description = "no matching triplets for 1001"
23+
24+
[bf17ba80-1596-409a-bb13-343bdb3b2904]
25+
description = "returns all matching triplets"
26+
27+
[9d8fb5d5-6c6f-42df-9f95-d3165963ac57]
28+
description = "several matching triplets"
29+
30+
[f5be5734-8aa0-4bd1-99a2-02adcc4402b4]
31+
description = "triplets for large number"

0 commit comments

Comments
 (0)