Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

60%
+1 −0
Sandbox Borromean coprimes [FINALIZED]

posted 1y ago by trichoplax‭  ·  edited 1y ago by trichoplax‭

#18: Post edited by user avatar trichoplax‭ · 2023-10-07T23:08:03Z (about 1 year ago)
Mark as finalized
  • Borromean coprimes
  • Borromean coprimes [FINALIZED]
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "True" and "False".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `False`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `False`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `True`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : "output"`.
  • You may use any 2 distinct values instead of "True" and "False".
  • ```text
  • 1, 1, 1 : "False"
  • 1, 1, 2 : "False"
  • 1, 1, 3 : "False"
  • 1, 2, 2 : "False"
  • 1, 2, 3 : "False"
  • 2, 2, 2 : "False"
  • 2, 2, 3 : "False"
  • 2, 3, 3 : "False"
  • 2, 3, 4 : "False"
  • 2, 3, 5 : "False"
  • 2, 4, 5 : "False"
  • 2, 4, 6 : "False"
  • 127, 127, 127: "False"
  • 18, 33, 88 : "True"
  • 108, 20, 105 : "True"
  • 98, 30, 105 : "True"
  • 22, 36, 33 : "True"
  • 82, 30, 123 : "True"
  • 40, 55, 22 : "True"
  • 45, 12, 10 : "True"
  • 38, 57, 78 : "True"
  • 35, 84, 80 : "True"
  • 84, 33, 22 : "True"
  • 105, 54, 80 : "True"
  • 26, 96, 39 : "True"
  • 18, 26, 117 : "True"
  • 50, 75, 48 : "True"
  • 95, 76, 70 : "True"
  • 50, 96, 45 : "True"
  • 85, 34, 40 : "True"
  • 84, 104, 39 : "True"
  • 45, 72, 110 : "True"
  • 72, 68, 51 : "True"
  • 20, 105, 28 : "True"
  • 75, 102, 100 : "True"
  • 90, 105, 14 : "True"
  • 105, 110, 84 : "True"
  • 78, 70, 21 : "True"
  • 105, 96, 14 : "True"
  • 110, 120, 33 : "True"
  • 70, 84, 15 : "True"
  • 50, 6, 105 : "True"
  • 70, 21, 45 : "True"
  • 48, 70, 21 : "True"
  • 76, 18, 57 : "True"
  • 126, 77, 66 : "True"
  • 6, 88, 99 : "True"
  • 33, 77, 126 : "True"
  • 88, 72, 33 : "True"
  • 12, 63, 56 : "True"
  • 80, 36, 105 : "True"
  • 35, 110, 77 : "True"
  • 21, 14, 18 : "True"
  • 68, 85, 70 : "True"
  • 75, 108, 80 : "True"
  • 18, 21, 98 : "True"
  • 26, 36, 39 : "True"
  • 30, 98, 21 : "True"
  • 50, 15, 36 : "True"
  • 78, 51, 34 : "True"
  • 44, 98, 77 : "True"
  • 114, 105, 80 : "True"
  • 15, 10, 72 : "True"
  • 5, 91, 18 : "False"
  • 51, 41, 98 : "False"
  • 66, 78, 20 : "False"
  • 76, 18, 50 : "False"
  • 124, 105, 50 : "False"
  • 54, 1, 93 : "False"
  • 60, 41, 104 : "False"
  • 127, 62, 40 : "False"
  • 112, 101, 122 : "False"
  • 7, 12, 74 : "False"
  • 18, 95, 71 : "False"
  • 123, 74, 3 : "False"
  • 51, 79, 7 : "False"
  • 9, 67, 98 : "False"
  • 37, 6, 90 : "False"
  • 43, 1, 45 : "False"
  • 36, 14, 44 : "False"
  • 37, 1, 111 : "False"
  • 55, 89, 26 : "False"
  • 90, 53, 28 : "False"
  • 83, 12, 31 : "False"
  • 19, 112, 5 : "False"
  • 92, 19, 99 : "False"
  • 58, 59, 124 : "False"
  • 9, 106, 85 : "False"
  • 108, 108, 6 : "False"
  • 69, 31, 76 : "False"
  • 96, 6, 42 : "False"
  • 105, 47, 90 : "False"
  • 43, 22, 29 : "False"
  • 113, 19, 73 : "False"
  • 77, 103, 113 : "False"
  • 91, 89, 17 : "False"
  • 60, 16, 61 : "False"
  • 44, 87, 115 : "False"
  • 28, 80, 108 : "False"
  • 11, 116, 76 : "False"
  • 105, 79, 95 : "False"
  • 62, 80, 80 : "False"
  • 7, 60, 104 : "False"
  • 91, 106, 34 : "False"
  • 125, 105, 56 : "False"
  • 9, 74, 87 : "False"
  • 88, 68, 6 : "False"
  • 40, 17, 109 : "False"
  • 116, 83, 29 : "False"
  • 102, 32, 110 : "False"
  • 121, 20, 85 : "False"
  • 112, 44, 121 : "False"
  • 74, 102, 39 : "False"
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • # Now posted: [Borromean coprimes](https://codegolf.codidact.com/posts/289921)
  • ---
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "True" and "False".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `False`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `False`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `True`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : "output"`.
  • You may use any 2 distinct values instead of "True" and "False".
  • ```text
  • 1, 1, 1 : "False"
  • 1, 1, 2 : "False"
  • 1, 1, 3 : "False"
  • 1, 2, 2 : "False"
  • 1, 2, 3 : "False"
  • 2, 2, 2 : "False"
  • 2, 2, 3 : "False"
  • 2, 3, 3 : "False"
  • 2, 3, 4 : "False"
  • 2, 3, 5 : "False"
  • 2, 4, 5 : "False"
  • 2, 4, 6 : "False"
  • 127, 127, 127: "False"
  • 18, 33, 88 : "True"
  • 108, 20, 105 : "True"
  • 98, 30, 105 : "True"
  • 22, 36, 33 : "True"
  • 82, 30, 123 : "True"
  • 40, 55, 22 : "True"
  • 45, 12, 10 : "True"
  • 38, 57, 78 : "True"
  • 35, 84, 80 : "True"
  • 84, 33, 22 : "True"
  • 105, 54, 80 : "True"
  • 26, 96, 39 : "True"
  • 18, 26, 117 : "True"
  • 50, 75, 48 : "True"
  • 95, 76, 70 : "True"
  • 50, 96, 45 : "True"
  • 85, 34, 40 : "True"
  • 84, 104, 39 : "True"
  • 45, 72, 110 : "True"
  • 72, 68, 51 : "True"
  • 20, 105, 28 : "True"
  • 75, 102, 100 : "True"
  • 90, 105, 14 : "True"
  • 105, 110, 84 : "True"
  • 78, 70, 21 : "True"
  • 105, 96, 14 : "True"
  • 110, 120, 33 : "True"
  • 70, 84, 15 : "True"
  • 50, 6, 105 : "True"
  • 70, 21, 45 : "True"
  • 48, 70, 21 : "True"
  • 76, 18, 57 : "True"
  • 126, 77, 66 : "True"
  • 6, 88, 99 : "True"
  • 33, 77, 126 : "True"
  • 88, 72, 33 : "True"
  • 12, 63, 56 : "True"
  • 80, 36, 105 : "True"
  • 35, 110, 77 : "True"
  • 21, 14, 18 : "True"
  • 68, 85, 70 : "True"
  • 75, 108, 80 : "True"
  • 18, 21, 98 : "True"
  • 26, 36, 39 : "True"
  • 30, 98, 21 : "True"
  • 50, 15, 36 : "True"
  • 78, 51, 34 : "True"
  • 44, 98, 77 : "True"
  • 114, 105, 80 : "True"
  • 15, 10, 72 : "True"
  • 5, 91, 18 : "False"
  • 51, 41, 98 : "False"
  • 66, 78, 20 : "False"
  • 76, 18, 50 : "False"
  • 124, 105, 50 : "False"
  • 54, 1, 93 : "False"
  • 60, 41, 104 : "False"
  • 127, 62, 40 : "False"
  • 112, 101, 122 : "False"
  • 7, 12, 74 : "False"
  • 18, 95, 71 : "False"
  • 123, 74, 3 : "False"
  • 51, 79, 7 : "False"
  • 9, 67, 98 : "False"
  • 37, 6, 90 : "False"
  • 43, 1, 45 : "False"
  • 36, 14, 44 : "False"
  • 37, 1, 111 : "False"
  • 55, 89, 26 : "False"
  • 90, 53, 28 : "False"
  • 83, 12, 31 : "False"
  • 19, 112, 5 : "False"
  • 92, 19, 99 : "False"
  • 58, 59, 124 : "False"
  • 9, 106, 85 : "False"
  • 108, 108, 6 : "False"
  • 69, 31, 76 : "False"
  • 96, 6, 42 : "False"
  • 105, 47, 90 : "False"
  • 43, 22, 29 : "False"
  • 113, 19, 73 : "False"
  • 77, 103, 113 : "False"
  • 91, 89, 17 : "False"
  • 60, 16, 61 : "False"
  • 44, 87, 115 : "False"
  • 28, 80, 108 : "False"
  • 11, 116, 76 : "False"
  • 105, 79, 95 : "False"
  • 62, 80, 80 : "False"
  • 7, 60, 104 : "False"
  • 91, 106, 34 : "False"
  • 125, 105, 56 : "False"
  • 9, 74, 87 : "False"
  • 88, 68, 6 : "False"
  • 40, 17, 109 : "False"
  • 116, 83, 29 : "False"
  • 102, 32, 110 : "False"
  • 121, 20, 85 : "False"
  • 112, 44, 121 : "False"
  • 74, 102, 39 : "False"
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#17: Post edited by user avatar trichoplax‭ · 2023-10-07T23:04:56Z (about 1 year ago)
Make outputs consistently title case
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : "output"`.
  • You may use any 2 distinct values instead of "True" and "False".
  • ```text
  • 1, 1, 1 : "False"
  • 1, 1, 2 : "False"
  • 1, 1, 3 : "False"
  • 1, 2, 2 : "False"
  • 1, 2, 3 : "False"
  • 2, 2, 2 : "False"
  • 2, 2, 3 : "False"
  • 2, 3, 3 : "False"
  • 2, 3, 4 : "False"
  • 2, 3, 5 : "False"
  • 2, 4, 5 : "False"
  • 2, 4, 6 : "False"
  • 127, 127, 127: "False"
  • 18, 33, 88 : "True"
  • 108, 20, 105 : "True"
  • 98, 30, 105 : "True"
  • 22, 36, 33 : "True"
  • 82, 30, 123 : "True"
  • 40, 55, 22 : "True"
  • 45, 12, 10 : "True"
  • 38, 57, 78 : "True"
  • 35, 84, 80 : "True"
  • 84, 33, 22 : "True"
  • 105, 54, 80 : "True"
  • 26, 96, 39 : "True"
  • 18, 26, 117 : "True"
  • 50, 75, 48 : "True"
  • 95, 76, 70 : "True"
  • 50, 96, 45 : "True"
  • 85, 34, 40 : "True"
  • 84, 104, 39 : "True"
  • 45, 72, 110 : "True"
  • 72, 68, 51 : "True"
  • 20, 105, 28 : "True"
  • 75, 102, 100 : "True"
  • 90, 105, 14 : "True"
  • 105, 110, 84 : "True"
  • 78, 70, 21 : "True"
  • 105, 96, 14 : "True"
  • 110, 120, 33 : "True"
  • 70, 84, 15 : "True"
  • 50, 6, 105 : "True"
  • 70, 21, 45 : "True"
  • 48, 70, 21 : "True"
  • 76, 18, 57 : "True"
  • 126, 77, 66 : "True"
  • 6, 88, 99 : "True"
  • 33, 77, 126 : "True"
  • 88, 72, 33 : "True"
  • 12, 63, 56 : "True"
  • 80, 36, 105 : "True"
  • 35, 110, 77 : "True"
  • 21, 14, 18 : "True"
  • 68, 85, 70 : "True"
  • 75, 108, 80 : "True"
  • 18, 21, 98 : "True"
  • 26, 36, 39 : "True"
  • 30, 98, 21 : "True"
  • 50, 15, 36 : "True"
  • 78, 51, 34 : "True"
  • 44, 98, 77 : "True"
  • 114, 105, 80 : "True"
  • 15, 10, 72 : "True"
  • 5, 91, 18 : "False"
  • 51, 41, 98 : "False"
  • 66, 78, 20 : "False"
  • 76, 18, 50 : "False"
  • 124, 105, 50 : "False"
  • 54, 1, 93 : "False"
  • 60, 41, 104 : "False"
  • 127, 62, 40 : "False"
  • 112, 101, 122 : "False"
  • 7, 12, 74 : "False"
  • 18, 95, 71 : "False"
  • 123, 74, 3 : "False"
  • 51, 79, 7 : "False"
  • 9, 67, 98 : "False"
  • 37, 6, 90 : "False"
  • 43, 1, 45 : "False"
  • 36, 14, 44 : "False"
  • 37, 1, 111 : "False"
  • 55, 89, 26 : "False"
  • 90, 53, 28 : "False"
  • 83, 12, 31 : "False"
  • 19, 112, 5 : "False"
  • 92, 19, 99 : "False"
  • 58, 59, 124 : "False"
  • 9, 106, 85 : "False"
  • 108, 108, 6 : "False"
  • 69, 31, 76 : "False"
  • 96, 6, 42 : "False"
  • 105, 47, 90 : "False"
  • 43, 22, 29 : "False"
  • 113, 19, 73 : "False"
  • 77, 103, 113 : "False"
  • 91, 89, 17 : "False"
  • 60, 16, 61 : "False"
  • 44, 87, 115 : "False"
  • 28, 80, 108 : "False"
  • 11, 116, 76 : "False"
  • 105, 79, 95 : "False"
  • 62, 80, 80 : "False"
  • 7, 60, 104 : "False"
  • 91, 106, 34 : "False"
  • 125, 105, 56 : "False"
  • 9, 74, 87 : "False"
  • 88, 68, 6 : "False"
  • 40, 17, 109 : "False"
  • 116, 83, 29 : "False"
  • 102, 32, 110 : "False"
  • 121, 20, 85 : "False"
  • 112, 44, 121 : "False"
  • 74, 102, 39 : "False"
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "True" and "False".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `False`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `False`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `True`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : "output"`.
  • You may use any 2 distinct values instead of "True" and "False".
  • ```text
  • 1, 1, 1 : "False"
  • 1, 1, 2 : "False"
  • 1, 1, 3 : "False"
  • 1, 2, 2 : "False"
  • 1, 2, 3 : "False"
  • 2, 2, 2 : "False"
  • 2, 2, 3 : "False"
  • 2, 3, 3 : "False"
  • 2, 3, 4 : "False"
  • 2, 3, 5 : "False"
  • 2, 4, 5 : "False"
  • 2, 4, 6 : "False"
  • 127, 127, 127: "False"
  • 18, 33, 88 : "True"
  • 108, 20, 105 : "True"
  • 98, 30, 105 : "True"
  • 22, 36, 33 : "True"
  • 82, 30, 123 : "True"
  • 40, 55, 22 : "True"
  • 45, 12, 10 : "True"
  • 38, 57, 78 : "True"
  • 35, 84, 80 : "True"
  • 84, 33, 22 : "True"
  • 105, 54, 80 : "True"
  • 26, 96, 39 : "True"
  • 18, 26, 117 : "True"
  • 50, 75, 48 : "True"
  • 95, 76, 70 : "True"
  • 50, 96, 45 : "True"
  • 85, 34, 40 : "True"
  • 84, 104, 39 : "True"
  • 45, 72, 110 : "True"
  • 72, 68, 51 : "True"
  • 20, 105, 28 : "True"
  • 75, 102, 100 : "True"
  • 90, 105, 14 : "True"
  • 105, 110, 84 : "True"
  • 78, 70, 21 : "True"
  • 105, 96, 14 : "True"
  • 110, 120, 33 : "True"
  • 70, 84, 15 : "True"
  • 50, 6, 105 : "True"
  • 70, 21, 45 : "True"
  • 48, 70, 21 : "True"
  • 76, 18, 57 : "True"
  • 126, 77, 66 : "True"
  • 6, 88, 99 : "True"
  • 33, 77, 126 : "True"
  • 88, 72, 33 : "True"
  • 12, 63, 56 : "True"
  • 80, 36, 105 : "True"
  • 35, 110, 77 : "True"
  • 21, 14, 18 : "True"
  • 68, 85, 70 : "True"
  • 75, 108, 80 : "True"
  • 18, 21, 98 : "True"
  • 26, 36, 39 : "True"
  • 30, 98, 21 : "True"
  • 50, 15, 36 : "True"
  • 78, 51, 34 : "True"
  • 44, 98, 77 : "True"
  • 114, 105, 80 : "True"
  • 15, 10, 72 : "True"
  • 5, 91, 18 : "False"
  • 51, 41, 98 : "False"
  • 66, 78, 20 : "False"
  • 76, 18, 50 : "False"
  • 124, 105, 50 : "False"
  • 54, 1, 93 : "False"
  • 60, 41, 104 : "False"
  • 127, 62, 40 : "False"
  • 112, 101, 122 : "False"
  • 7, 12, 74 : "False"
  • 18, 95, 71 : "False"
  • 123, 74, 3 : "False"
  • 51, 79, 7 : "False"
  • 9, 67, 98 : "False"
  • 37, 6, 90 : "False"
  • 43, 1, 45 : "False"
  • 36, 14, 44 : "False"
  • 37, 1, 111 : "False"
  • 55, 89, 26 : "False"
  • 90, 53, 28 : "False"
  • 83, 12, 31 : "False"
  • 19, 112, 5 : "False"
  • 92, 19, 99 : "False"
  • 58, 59, 124 : "False"
  • 9, 106, 85 : "False"
  • 108, 108, 6 : "False"
  • 69, 31, 76 : "False"
  • 96, 6, 42 : "False"
  • 105, 47, 90 : "False"
  • 43, 22, 29 : "False"
  • 113, 19, 73 : "False"
  • 77, 103, 113 : "False"
  • 91, 89, 17 : "False"
  • 60, 16, 61 : "False"
  • 44, 87, 115 : "False"
  • 28, 80, 108 : "False"
  • 11, 116, 76 : "False"
  • 105, 79, 95 : "False"
  • 62, 80, 80 : "False"
  • 7, 60, 104 : "False"
  • 91, 106, 34 : "False"
  • 125, 105, 56 : "False"
  • 9, 74, 87 : "False"
  • 88, 68, 6 : "False"
  • 40, 17, 109 : "False"
  • 116, 83, 29 : "False"
  • 102, 32, 110 : "False"
  • 121, 20, 85 : "False"
  • 112, 44, 121 : "False"
  • 74, 102, 39 : "False"
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#16: Post edited by user avatar trichoplax‭ · 2023-10-07T23:02:00Z (about 1 year ago)
Add randomly generated test cases including inputs up to and including 127
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : "output"`.
  • You may use any 2 distinct values instead of "True" and "False".
  • ```text
  • 1, 1, 1 : "False"
  • 1, 1, 2 : "False"
  • 1, 1, 3 : "False"
  • 1, 2, 2 : "False"
  • 1, 2, 3 : "False"
  • 2, 2, 2 : "False"
  • 2, 2, 3 : "False"
  • 2, 3, 3 : "False"
  • 2, 3, 4 : "False"
  • 2, 3, 5 : "False"
  • 2, 4, 5 : "False"
  • 2, 4, 6 : "False"
  • 127, 127, 127: "False"
  • 18, 33, 88 : "True"
  • 108, 20, 105 : "True"
  • 98, 30, 105 : "True"
  • 22, 36, 33 : "True"
  • 82, 30, 123 : "True"
  • 40, 55, 22 : "True"
  • 45, 12, 10 : "True"
  • 38, 57, 78 : "True"
  • 35, 84, 80 : "True"
  • 84, 33, 22 : "True"
  • 105, 54, 80 : "True"
  • 26, 96, 39 : "True"
  • 18, 26, 117 : "True"
  • 50, 75, 48 : "True"
  • 95, 76, 70 : "True"
  • 50, 96, 45 : "True"
  • 85, 34, 40 : "True"
  • 84, 104, 39 : "True"
  • 45, 72, 110 : "True"
  • 72, 68, 51 : "True"
  • 20, 105, 28 : "True"
  • 75, 102, 100 : "True"
  • 90, 105, 14 : "True"
  • 105, 110, 84 : "True"
  • 78, 70, 21 : "True"
  • 105, 96, 14 : "True"
  • 110, 120, 33 : "True"
  • 70, 84, 15 : "True"
  • 50, 6, 105 : "True"
  • 70, 21, 45 : "True"
  • 48, 70, 21 : "True"
  • 76, 18, 57 : "True"
  • 126, 77, 66 : "True"
  • 6, 88, 99 : "True"
  • 33, 77, 126 : "True"
  • 88, 72, 33 : "True"
  • 12, 63, 56 : "True"
  • 80, 36, 105 : "True"
  • 35, 110, 77 : "True"
  • 21, 14, 18 : "True"
  • 68, 85, 70 : "True"
  • 75, 108, 80 : "True"
  • 18, 21, 98 : "True"
  • 26, 36, 39 : "True"
  • 30, 98, 21 : "True"
  • 50, 15, 36 : "True"
  • 78, 51, 34 : "True"
  • 44, 98, 77 : "True"
  • 114, 105, 80 : "True"
  • 15, 10, 72 : "True"
  • 5, 91, 18 : "False"
  • 51, 41, 98 : "False"
  • 66, 78, 20 : "False"
  • 76, 18, 50 : "False"
  • 124, 105, 50 : "False"
  • 54, 1, 93 : "False"
  • 60, 41, 104 : "False"
  • 127, 62, 40 : "False"
  • 112, 101, 122 : "False"
  • 7, 12, 74 : "False"
  • 18, 95, 71 : "False"
  • 123, 74, 3 : "False"
  • 51, 79, 7 : "False"
  • 9, 67, 98 : "False"
  • 37, 6, 90 : "False"
  • 43, 1, 45 : "False"
  • 36, 14, 44 : "False"
  • 37, 1, 111 : "False"
  • 55, 89, 26 : "False"
  • 90, 53, 28 : "False"
  • 83, 12, 31 : "False"
  • 19, 112, 5 : "False"
  • 92, 19, 99 : "False"
  • 58, 59, 124 : "False"
  • 9, 106, 85 : "False"
  • 108, 108, 6 : "False"
  • 69, 31, 76 : "False"
  • 96, 6, 42 : "False"
  • 105, 47, 90 : "False"
  • 43, 22, 29 : "False"
  • 113, 19, 73 : "False"
  • 77, 103, 113 : "False"
  • 91, 89, 17 : "False"
  • 60, 16, 61 : "False"
  • 44, 87, 115 : "False"
  • 28, 80, 108 : "False"
  • 11, 116, 76 : "False"
  • 105, 79, 95 : "False"
  • 62, 80, 80 : "False"
  • 7, 60, 104 : "False"
  • 91, 106, 34 : "False"
  • 125, 105, 56 : "False"
  • 9, 74, 87 : "False"
  • 88, 68, 6 : "False"
  • 40, 17, 109 : "False"
  • 116, 83, 29 : "False"
  • 102, 32, 110 : "False"
  • 121, 20, 85 : "False"
  • 112, 44, 121 : "False"
  • 74, 102, 39 : "False"
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#15: Post edited by user avatar trichoplax‭ · 2023-10-04T13:36:26Z (about 1 year ago)
Make parameter names consistent
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(x, y):
  • return gcd(x, y) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#14: Post edited by user avatar trichoplax‭ · 2023-10-04T06:36:20Z (about 1 year ago)
Mention example code is in Python
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • Here is some Python code that meets the requirements of this challenge. The function `borromean_coprimes` returns `True` or `False`.
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#13: Post edited by user avatar trichoplax‭ · 2023-10-03T19:46:35Z (about 1 year ago)
Add syntax highlighting
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```text
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```python
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#12: Post edited by user avatar trichoplax‭ · 2023-10-03T19:41:51Z (about 1 year ago)
Add non-golfed example code
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```text
  • To be added, probably in Python
  • unless there's a preference
  • for something else.
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```text
  • from math import gcd
  • def borromean_coprimes(x, y, z):
  • return (
  • coprime_triple(x, y, z)
  • and not coprime(x, y)
  • and not coprime(x, z)
  • and not coprime(y, z)
  • )
  • def coprime(a, b):
  • return gcd(a, b) == 1
  • def coprime_triple(x, y, z):
  • return gcd(x, y, z) == 1
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#11: Post edited by user avatar trichoplax‭ · 2023-10-03T18:58:18Z (about 1 year ago)
Placeholder for non-golfed example implementation
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Non-golfed example code
  • ```text
  • To be added, probably in Python
  • unless there's a preference
  • for something else.
  • ```
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#10: Post edited by user avatar trichoplax‭ · 2023-10-03T09:55:58Z (about 1 year ago)
Improve definition wording
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • The triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • In summary, the triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#9: Post edited by user avatar trichoplax‭ · 2023-10-03T09:52:33Z (about 1 year ago)
Specify inputs cannot be assumed to be sorted
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • The triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • The triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be as 3 separate inputs, or any ordered data structure.
  • - Your code must work for integers in any order (you must not assume that they are sorted).
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#8: Post edited by user avatar trichoplax‭ · 2023-10-03T09:25:26Z (about 1 year ago)
Mention Borromean rings
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • The triple of integers is coprime, but removing any single integer leaves a pair of integers that are not coprime. The name is by analogy with [Borromean rings](https://en.m.wikipedia.org/wiki/Borromean_rings).
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#7: Post edited by user avatar trichoplax‭ · 2023-10-03T09:08:13Z (about 1 year ago)
Specify input upper limit
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • - Your code must support input integers up to and including 127.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#6: Post edited by user avatar trichoplax‭ · 2023-10-02T12:12:31Z (about 1 year ago)
Permute some test cases
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 6, 15, 10 : true
  • 10, 6, 15 : true
  • 10, 15, 6 : true
  • 15, 6, 10 : true
  • 15, 10, 6 : true
  • 12, 20, 30 : false
  • 12, 30, 20 : false
  • 20, 12, 30 : false
  • 20, 30, 12 : false
  • 30, 12, 20 : false
  • 30, 20, 12 : false
  • 42, 70, 105 : false
  • 42, 105, 70 : false
  • 70, 42, 105 : false
  • 70, 105, 42 : false
  • 105, 42, 70 : false
  • 105, 70, 42 : false
  • 14, 30, 105 : true
  • 14, 105, 30 : true
  • 30, 14, 105 : true
  • 30, 105, 14 : true
  • 105, 14, 30 : true
  • 105, 30, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#5: Post edited by user avatar trichoplax‭ · 2023-10-02T11:20:32Z (about 1 year ago)
Fix potentially misleading wording of third example
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of the triple is 1, and the greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#4: Post edited by user avatar trichoplax‭ · 2023-10-02T02:28:23Z (about 1 year ago)
Simplify
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • For the purposes of this challenge, the following definition will be used:
  • - 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - Choose 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • All of the GCDs are greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - 1 of 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • The greatest common divisor of every pair is greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • You may use any 2 distinct values instead of "true" and "false".
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#3: Post edited by user avatar trichoplax‭ · 2023-10-02T00:22:21Z (about 1 year ago)
Make second example more distinct from the first
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • For the purposes of this challenge, the following definition will be used:
  • - 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - Choose 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 4`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • All of the GCDs are greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • For the purposes of this challenge, the following definition will be used:
  • - 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - Choose 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 5`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • All of the GCDs are greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#2: Post edited by user avatar trichoplax‭ · 2023-10-02T00:19:40Z (about 1 year ago)
Remove superfluous input rule
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • For the purposes of this challenge, the following definition will be used:
  • - 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • - Here "integer" means a number with zero fractional part. This does not need to be a data type named "integer". For example, you are free to take input as floating point numbers that happen to have zero fractional part.
  • ## Output
  • - Choose 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 4`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • All of the GCDs are greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given 3 positive integers, indicate whether they are Borromean coprimes.
  • ## Definition
  • For the purposes of this challenge, the following definition will be used:
  • - 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
  • - Their greatest common divisor is 1.
  • - The greatest common divisor of every pair is greater than 1.
  • ## Input
  • - 3 positive integers.
  • - This may be 3 separate inputs, or any ordered or unordered data structure.
  • ## Output
  • - Choose 2 distinct values to represent "true" and "false".
  • ## Examples
  • ### GCD not equal to 1 for the triple
  • - Input: `2, 4, 6`
  • - Output: `false`
  • The greatest common divisor of the triple is 2, so these are not Borromean coprimes.
  • ### GCD equal to 1 for a pair
  • - Input: `2, 3, 4`
  • - Output: `false`
  • The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.
  • ### Borromean coprimes
  • - Input: `6, 10, 15`
  • - Output: `true`
  • The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
  • - GCD(6, 10) = 2
  • - GCD(6, 15) = 3
  • - GCD(10, 15) = 5
  • All of the GCDs are greater than 1, so these are Borromean coprimes.
  • ## Test cases
  • Test cases are in the format `comma, separated, inputs : output`.
  • ```text
  • 1, 1, 1 : false
  • 1, 1, 2 : false
  • 1, 1, 3 : false
  • 1, 2, 2 : false
  • 1, 2, 3 : false
  • 2, 2, 2 : false
  • 2, 2, 3 : false
  • 2, 3, 3 : false
  • 2, 3, 4 : false
  • 2, 3, 5 : false
  • 2, 4, 5 : false
  • 2, 4, 6 : false
  • 6, 10, 15 : true
  • 12, 20, 30 : false
  • 42, 70, 105 : false
  • 30, 105, 14 : true
  • ```
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#1: Initial revision by user avatar trichoplax‭ · 2023-10-01T23:08:21Z (about 1 year ago)
Borromean coprimes
Given 3 positive integers, indicate whether they are Borromean coprimes.

## Definition
For the purposes of this challenge, the following definition will be used:

- 3 positive integers are called ***Borromean coprimes*** if both of the following are true:
    - Their greatest common divisor is 1.
    - The greatest common divisor of every pair is greater than 1.

## Input
- 3 positive integers.
- This may be 3 separate inputs, or any ordered or unordered data structure.
- Here "integer" means a number with zero fractional part. This does not need to be a data type named "integer". For example, you are free to take input as floating point numbers that happen to have zero fractional part.

## Output
- Choose 2 distinct values to represent "true" and "false".

## Examples
### GCD not equal to 1 for the triple
- Input: `2, 4, 6`
- Output: `false`

The greatest common divisor of the triple is 2, so these are not Borromean coprimes.

### GCD equal to 1 for a pair
- Input: `2, 3, 4`
- Output: `false`

The greatest common divisor of the pair `2, 3` is 1, so these are not Borromean coprimes.

### Borromean coprimes
- Input: `6, 10, 15`
- Output: `true`

The greatest common divisor of the triple is 1, and the greatest common divisors of each pair are:
- GCD(6, 10) = 2
- GCD(6, 15) = 3
- GCD(10, 15) = 5

All of the GCDs are greater than 1, so these are Borromean coprimes.

## Test cases
Test cases are in the format `comma, separated, inputs : output`.

```text
1, 1, 1 : false
1, 1, 2 : false
1, 1, 3 : false
1, 2, 2 : false
1, 2, 3 : false
2, 2, 2 : false
2, 2, 3 : false
2, 3, 3 : false
2, 3, 4 : false
2, 3, 5 : false
2, 4, 5 : false
2, 4, 6 : false
6, 10, 15 : true
12, 20, 30 : false
42, 70, 105 : false
30, 105, 14 : true
```

## Scoring
This is a [code golf challenge]. Your score is the number of bytes in your code.

> Explanations are optional, but I'm more likely to upvote answers that have one.


[code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"