# All Questions

11,600 questions
Filter by
Sorted by
Tagged with
180 views

### Squeezy sequence, sideways sedimentation

Challenge Premise I've got multiple pretty numbers all in a row. Each is a decimal digit. 0s are weakly attracted to 0s, 1s are attracted to 1s a little more strongly and so on until 9. I don't ...
1k views

1k views

### Penney-Conway odds

Background Penney's game is a two-player game about coin tossing. Player A announces a sequence of heads and tails of length $n$, then player B selects a different sequence of same length. The ...
443 views

### Are these two DFAs equivalent?

Two Deterministic Finite Automata or DFAs can be checked to see if they accept same set of strings in polynomial time. See section 3.3 of this for a long list of methods and this SO question/answer ...
299 views

### Acyclic orientations of an n-dimensional cube

The goal of this challenge is to check and extend the OEIS sequence A334248: Number of distinct acyclic orientations of the edges of an n-dimensional cube. Take an n-dimensional cube (if n=1, this is ...
5k views

### How many fingers does bad pianist need?

Challenge Premise Bob is a novice pianist who can only play sequences of single notes. In addition, he does quite an interesting thing: for every note after the first, if it's higher than the ...
3k views

### Create pixel art!

The task Given an image as input, your task is to do the following: Resize the image so it is At least 2 times smaller, but still has the same width/height ratio by taking every second (if resized ...
473 views

4k views

### Make 1s using a bunch of 1s

Your task is to form an expression equaling $11111111111 \text{ (11 ones)}$ using only the following characters: 1+(). Keep in mind that the result is in base ...
3k views

### Tribute to John Conway: Collatz in FRACTRAN

John Horton Conway was a brilliant mathematician. Among his contributions were three Turing-complete esolangs: Game of Life (esolangs wiki), FRACTRAN (esolangs wiki), and Collatz function (esolangs ...
297 views

### Positioning a fake mirror for best effect

Challenge Premise Consider a mosaic of $m\times n$ tiles, in $k$ unique colours designated by integers. Example ($3\times6$, four colours): ...
1k views

### Parse a Baseball Pitch String

Take an arbitrarily sized string as input. This string represents a baseball plate appearance, in which each character represents a pitch as follows: Strike: S ...
828 views

### Generate Green Spray Paint Patterns

This challenge is about creating these neat "green spray paint" patterns: (more pictures below) Loosely explained, they are generated by starting with a black image and a point in the center. ...
132 views

### Simulate the isotropic non-totalistic cellular automaton

There are many generalizations of Conway's Game of Life. One of them is the isotropic non-totalistic rulespace, in which the state of a cell in the next generation depends not just on its state and ...
148 views

### What is the longest possible DDL query in PostgreSQL?

We all know and love the corpulent DDL expressions one can write in PostgreSQL with wording like DEFERRABLE INITIALLY DEFERRED, ...
1k views

### No-Three-In-A-Line

Note: this problem was inspired by the Unsolved Mathematical Problems for K-12 youtube video, which also features other interesting puzzles. From the wikipedia article: The no-three-in-line ...
315 views

### This Question Has _____ Views [duplicate]

Inspired by this Youtube Video from Tom Scott. Write a program or function that prints the current amount of views this question has. That's it. Your program may only access the stack exchange api, ...
138 views

### Construct the suffix automaton

In computer science, a suffix automaton is the smallest partial deterministic finite automaton that recognizes the set of suffixes of a given string. (Wikipedia) Given a string $S$ consisting of ...
2k views

### The ultimate inequality challenge

Task Given two positive integers a, b and a Unicode mathematical inequality symbol c, ...
218 views

### Find the min and max number of substitutions

The Levenshtein distance between two strings is the minimum number of single character insertions, deletions and substitutions needed to transform one string into the other. Let us call insertions, ...
1k views

### Bit delivery in Bin City

sandbox Story Similar to a newspaper route you have been tasked with delivering bits to the residents of Bin City. Just as certain people like certain newspapers, the citizens of Bin City prefer ...
397 views

### Write a program that checks the consistency of modern mathematics

Modern mathematics has been formalised using set theory by various systems of axioms. Zermelo Frankel set theory with the axiom of choice (ZFC) forms an intuitive set of axioms and is hence most ...
7k views

### Conway's Monster

This challenge is in honor of mathematician John Conway who passed away April 11, 2020 due to COVID-19. He was famous for coming up with the Game of Life cellular automaton and many other mathematical ...
796 views

### Draw the prime race tracks

Odd prime numbers are either in the form of 4k+1 or 4k+3 where k is a non-negative integer. ...
3k views

### Are you ready to meet the Elite-Four?

To be able to challenge the Elite-4 of top programmers, you need to show your badges first, that qualify you as a potential programmer-master. However, there's a twist. Once you show a badge, it is ...
2k views

### Euler's Geometry Puzzle

Today (or tomorrow, depending on your timezone, by the time of posting) is the birthday of the great mathematician and physicist Leonhard Euler. To celebrate his birthday, this challenge is about one ...
131 views

### Mixed fractions without delimiters

Help! I printed a bunch of rational numbers with no spaces or other delimiters other than the / in the fractions. There is, however, good news! All the numbers are ...
2k views

### Sum in 2540 sums

This is my attempt to pair code-shuffleboard with code-golf. You need to write a full program or function that sums all codepoints of the input string. If there is no input, you can output any number,...
664 views

### Make a rectangle from a collection of (sliced) squares

Inspired by Make a Rectangle from a Triangle. Task There is a famous formula on the sum of first $n$ squares: $$1^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}$$ It is known that this number ...
779 views

### Program that compiles into itself

We've had lots of questions about quines, programs where the source code and output are identical. For compiled languages, there are other combinations: we've already had a question about writing a ...
899 views

### Counting Queen's paths on a rectangular chessboard

Task Given two positive integers $m,n$, imagine a chessboard of size $m \times n$. A chess queen is on the upper-left corner. In how many ways can it reach the lower-right corner, by moving only ...
110 views

### Find acronym-like words in a sentence

Let's say you have a sentence like: this is a very long sentence with several words of no significance It contains only the 26 lowercase letters of the alphabet ...
1k views

### Compactify the input

Given a word, your task is to compact it by saving its first character and removing any other vowel (aeiou). Input Your input can be the word in STDIN, a function argument or any other input format ...
504 views

### Produce an image based on an elementary cellular automata ruleset

What is elementary cellular automata? Since I'm not sure I'll be able to explain this so that somebody who has never heard of this is able to understand, I'm giving an explanation from https://...
1k views

### Symmetric difference

Surprised that we don't have a symmetric difference challenge yet. Given two lists only containing positive integers, return all items among these two lists that aren't contained in both of the lists....
269 views

### Counting shortest paths on a triangular grid

Background An Eisenstein integer is a complex number of the form $z = a + b\omega$ where $a, b$ are integers and $\omega$ is the third root of unity $\frac{1-\sqrt3i}{2}$. The Eisenstein ...
926 views

### How Many Ways To Empty The Glove Box?

Inspired by this glove-themed 538 Riddler Express Puzzle. Task You are given a positive integer n, and a list ...
1k views

### Is it a brainfuck instruction?

A very simple challenge today. Output a truthy value whether the ASCII character (or it's code) supplied is a brainfuck instruction (one of +-,.<>[]), and a ...
51 views

### Find two contiguous subarrays with the greatest difference [closed]

Here's an interview question I've seen on a few sites. People claim that an O(n) solution is possible, but I've been racking my brain these last 2 days and I couldn'...
217 views

### C&R: Chase the Easter Bunny™️️, be the Easter Bunny™

Chat room: https://chat.stackexchange.com/rooms/106513/easter-bunny-challenge Git repo: https://github.com/ajfaraday/easter_bunny_hunt The garden is a 2-dimensional grid with 49 rows and 49 columns. ...