Linked Questions
14 questions linked to/from Greatest Common Divisor
67
votes
226
answers
17k
views
Add two numbers
Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list.
...
40
votes
101
answers
5k
views
Divisibility test
Task
Given two strictly positive integers n and d as input, determine whether n is evenly divisible by d, i.e., if there exists an integer q such that n = qd.
You ...
51
votes
80
answers
9k
views
Do n and n^3 have the same set of digits?
Given a number n (0 <= n <= 2642245), check if n and n3 have the same set of digits, and output a truthy or falsey value accordingly.
For example, let's check the number 100.
1003 is 1000000.
...
84
votes
26
answers
18k
views
Shortest code to throw SIGILL
Background
We already have a challenge about throwing SIGSEGV, so why not a challenge about throwing SIGILL?
What is SIGILL?
SIGILL is the signal for an illegal instruction at the processor, which ...
35
votes
47
answers
3k
views
Least Common Multiple
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each ...
45
votes
33
answers
6k
views
Tips for golfing in x86/x64 machine code
I noticed that there's no such question, so here it is:
Do you have general tips for golfing in x86/x64 machine code? If the tip only applies to a certain environment or calling convention, please ...
32
votes
39
answers
5k
views
Calculate Euler's totient function
Background
Euler's totient
function φ(n) is defined as the number of whole numbers less than or equal to n that are relatively ...
29
votes
43
answers
6k
views
Convert a 32 bit binary IPv4 address to its quad-dotted notation
Challenge
Write a program or function that converts a 32 bit binary number to its quad-dotted decimal notation (often used for representing IPv4)
Quad-dotted decimal
A quad-dotted decimal is formed ...
38
votes
22
answers
4k
views
Natural Pi #0 - Rock
Goal
Create a program/function that takes an input N, check if N random pairs of integers are relatively prime, and returns <...
17
votes
26
answers
2k
views
Adding fractions
Write a program or a function that takes two non-empty lists of the same length as input and does the following:
uses elements of first list to get numerators,
uses elements of the second list to get ...
22
votes
14
answers
2k
views
The Euclidean Algorithm (for finding the greatest common divisor)
The Challenge
Write a program or function that takes two input integers, i and j, and outputs their greatest common divisor; ...
17
votes
12
answers
1k
views
Find the tangent of the sum of inverse tangents
Background
It can be shown that for any integer k >= 0, f(k) = tan(atan(0) + atan(1) + atan(2) + ... + atan(k)) is a ...
14
votes
14
answers
2k
views
Compute the Wilson numbers
Given a positive integer n, compute the nth Wilson number W(n) where
and e = 1 if n has a primitive root modulo n, otherwise e = -1. In other words, n has a primitive root if there does not exist an ...
29
votes
8
answers
2k
views
Codeium Golfide
In this challenge, your task is to take an anion and a cation, and output the chemical formula of the compound.
Input rules
Take in 2 strings (in any order) representing the anion and cation, e.g. <...