Given a non-empty string (or an integer, or a list/array if you prefer) composed exclusively of digits in the range [1-9], your task is to write a function (or a whole program) that applies a “…
Description Given an unsorted array of integers, find the smallest positive integer that does not appear in the array. Your task is to write the shortest code possible to solve this problem. Input A …
I was playing with the Fibonacci sequence in binary like so (note that the binary representations are written here from smallest bit to largest bit): …
It seems we’ve managed to go all this time without a plain vanilla Number-To-Binary challenge! Whilst this will inevitably be only one element in many languages, it should put a few esolangs through …
In Haskell (and probably some other languages or something) zip is a function which takes two lists, and produces a list of tuples by pairing elements at the same …
There is a building with an infinite number of floors and you are the only passenger in an elevator which can lift an infinite number of people. You are going home, but before the elevator gets to …
The ubiquitous Catalan numbers \$C_n\$ count the number of Dyck paths, sequences of up-steps and down-steps of length \$2n\$ that start and end on a horizontal line and never go below said line. Many …
Write a program that prints its own source code out backwards, in other words an eniuq. Scoring: +50 if you use pull data from the Internet. +25 if you read your own source code. +1 point per …
Polygons are named after the number of sides that they have. A pentagon has 5 sides, an octagon has 8 sides. But how are they named? What’s the name for a 248-sided polygon? All polygons are suffixed …
Background HQ0-9+-INCOMPUTABLE?! is a half-joke programming language introduced in Internet Problem Solving Contest 2011, Problem H. HQ9+ is an esoteric programming language specialized for certain …
Background “Fly straight, dammit” (OEIS A133058) is a sequence of integers, which has these rules: \$a_0 = a_1 = 1\$ \$a_n = a_{n-1}+n+1\$ if \$gcd(a_{n-1}, n) = 1\$ Otherwise, \$a_n = \…
Winner: professorfish’s bash answer! An entire 9 bytes! Wow! You may continue to submit your answer, however you can no longer win. Original post kept for posterity: Your goal is to convert a whole …
Credits to Calvin’s Hobbies for nudging my challenge idea in the right direction. Consider a set of points in the plane, which we will call sites, and associate a colour with each site. Now you can …
Write a program that prints “Hello, World!”. But also, if you take only the first, third, fifth, etc. characters of your program, the resulting program should still print “Hello, World!”. If your …
It is well-known that a 3D rotation can always be represented by a quaternion. It is less well-known that a 4D rotation can always be represented by two quaternions, sending a point \$p=(a,b,c,d)^T\$ …