All Questions

Filter by
Sorted by
Tagged with
31
votes
9answers
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 ...
30
votes
2answers
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 ...
10
votes
1answer
298 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): ...
15
votes
15answers
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 ...
17
votes
5answers
866 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. ...
2
votes
0answers
133 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 ...
1
vote
0answers
157 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, ...
21
votes
7answers
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 ...
8
votes
9answers
318 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, ...
2
votes
0answers
142 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 ...
22
votes
11answers
2k views

The ultimate inequality challenge

Task Given two positive integers a, b and a Unicode mathematical inequality symbol c, ...
5
votes
1answer
220 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, ...
12
votes
8answers
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 ...
13
votes
0answers
409 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 ...
48
votes
29answers
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 ...
7
votes
9answers
807 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. ...
17
votes
15answers
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 ...
17
votes
8answers
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 ...
1
vote
0answers
137 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 ...
12
votes
21answers
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,...
17
votes
3answers
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 ...
22
votes
1answer
798 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 ...
13
votes
6answers
902 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 ...
3
votes
3answers
232 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 ...
16
votes
30answers
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 ...
8
votes
7answers
512 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://...
15
votes
22answers
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....
9
votes
10answers
273 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 ...
10
votes
18answers
927 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 ...
3
votes
24answers
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 ...
2
votes
0answers
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'...
6
votes
1answer
284 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. ...
-1
votes
11answers
265 views

Let's start with a brainy quote

The challenge today is to write a program that outputs a known proverb, Where there is a will, there is a way., that means if someone is determined to do something, ...
3
votes
1answer
193 views

Check if hand from card game “Rooster” is valid for the second stage

Here in Russia, we have a little-known card game with the name, when translated directly, means Rooster. The cards used are two full 54-card decks of playing cards from 2 through aces, with jokers. ...
10
votes
38answers
4k views

Make your code error, but only sometimes!

Your task is to create a program or function which randomly errors. Specifically, there must be a nonzero probability of erroring, but also a nonzero probability of running without error. An error is ...
11
votes
7answers
1k views

Modify The Stack

Let's say you have a stack, which at the start contains a b c in this order (a is on the top). You are given the required output ...
-8
votes
22answers
265 views

Produce all even primes

A prime number is a positive integer that has exactly two divisors 1 and the number itself. For example number 7 is a prime since it is divisible by 1 and 7. Number 1 is not a prime since it has only ...
4
votes
2answers
334 views

Chase the Easter Bunny and collect his eggs

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. ...
23
votes
11answers
2k views

Find a Similar Number

We consider two integers to be similar if, when written in decimal, have the same length, and if we compare characters in any two positions for both decimal strings, the comparison results (less, ...
11
votes
2answers
359 views

Spanning paths in a tournament on n nodes

The goal of this challenge is to extend the On-Line Encyclopedia of Integer Sequences (OEIS) sequence A038375. Maximal number of spanning paths in tournament on n nodes. A tournament on \$n\$ ...
11
votes
4answers
2k views

Who's that pokemon (based on its etymology)?

As we all know, most Pokemon are created by combining some English (or Japanese) words; these words are the Pokemon's "etymology." For example, "charmander" is "char" and "salamander" put together. ...
20
votes
16answers
3k views

Make a Rectangle from a Triangle

You can depict a triangular number, T(N), by writing one 1 on a line, then two 2's on the line below, then three 3's on the line below that, and so on until N N's. You end up with a triangle of T(N) ...
12
votes
8answers
401 views

Minimal Rotate-Right-Double numbers in base n

Task For a given base \$n \ge 3\$, find the smallest positive integer \$m\$, when written in base \$n\$ and rotated right once, equals \$2m\$. The base-\$n\$ representation of \$m\$ cannot have ...
4
votes
6answers
221 views

FizzBuzz: Least unique bytes [duplicate]

Introduction: Although it seems challenges scored by least unique characters have been attempted, there are few which were well-received. I think it's a potentially interesting scoring criterion, as ...
16
votes
8answers
2k views

Is this a rectangle?

The challenge: Given four coordinates, each in x y form, your job is to find out whether or not the given coordinates form a rectangle, and output a truthy/falsey. Rules: For the sake of simplicity,...
23
votes
48answers
3k views

Triangular code, triangular output

For this challenge, submissions should be a program or function shaped like a right triangle, which produces a right triangle of the same size. What is a right triangle? For this challenge, a right ...
19
votes
22answers
2k views

Convert to and from Base 94

The challenge Make 2 programs which convert decimal to and from base 94, or a bidirectional program. Base 94? Base 94 is like any other base, but instead of 0 to 9 and letters, it uses ASCII ...
24
votes
9answers
835 views

Maintain diagonal symmetry when placing N items on a square grid

Write a program that takes in two non-negative integers S and N in that order. S represents the side length of a square grid of . characters. N represents the ...
6
votes
2answers
244 views

Decode Arabic to Arabic Presentation Form

Objective Given an Arabic string consisting of ISO/IEC 8859-6 Arabic letters (U+0621–063A, 0640–064A), decode it to Arabic Presentation Forms-B (U+FE70–FEFF). Behavior of Arabic letters ISO/IEC ...
31
votes
19answers
2k views

Check membership of an infinite list

As input you will receive An integer \$a\$ A list of integers that is infinite and strictly-monotonic1. Your program should check in finite time if \$a\$ appears the list. You should output one of ...

15 30 50 per page
1
5 6
7
8 9
234