14 questions linked to/from Greatest Common Divisor
17k views

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. ...
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 ...
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. ...
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 ...
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 ... 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 ...
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 ...
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 ...
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 <...
2k views

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 ... 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; ...
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 ...