All Questions

Filter by
Sorted by
Tagged with
3
votes
5answers
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 ...
16
votes
9answers
1k views

The Koszul Sign Rule

A Bit of Background The exterior algebra is a central object in topology and physics (for the physics concept cf. fermion). The basic rule dictating the behavior of the exterior algebra is that \$yx =...
19
votes
2answers
323 views

Exactly N in a line

Given a number N from 2 to 8, place any nonzero number of queens on a grid of any size so that every queen has exactly N queens (counting itself) in each of its row, column, and each diagonal. This ...
19
votes
40answers
6k views

Bl lu ur rr ry yv vi is si io on - Blur the text

Task Given a string as input, generate a "blurred" version of that string. Input Your input will be a single-line string of ASCII characters, containing a minimum of 2 alphanumeric characters ...
21
votes
16answers
2k views

Is this a winning *Frustration* configuration?

Frustration is a solitaire card game which is played by calling out the sequence: “Ace”, “Two”, “Three”, ... , "Nine", "Ten", “Jack”, “Queen”, “King”, “Ace”, “Two”, etc. With each call, you ...
3
votes
4answers
114 views

Mask values in a .env file for a screencast [closed]

Let's say I have a .env file with the following contents: ...
2
votes
1answer
105 views

Code golfing my guess the number game with feedback in NS-HUBASIC - Can it be code golfed any further?

The player has to keep guessing a number from 1 to 10 until they guess the correct number to win the game. If they make an incorrect guess, they're told if their guess was too low or too high. Each ...
21
votes
10answers
2k views

Perimeter of Conway hexagon

Background Given a triangle \$ABC\$, extend its three sides by the opposite side length, as shown in the figure below. Then the six points surprisingly lie on a circle called the Conway circle, whose ...
23
votes
7answers
2k views

Where to point a low-orbit ion cannon (asking for a friend)

Challenge Premise Bob lost1 Alice's precious grand piano. Big mistake. Alice has now stolen Bob's low-orbit ion cannon. Alice refuses to just make up with Bob, so let's help her give him a light ...
15
votes
43answers
2k views

Generate list of numbers and their negative counterparts

A recent SO question asks for a convenient one-liner to generate a list of numbers and their negative counterparts in Python. Given two integers \$1≤a≤b\$, generate all the integers \$x\$ such that \$...
20
votes
14answers
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 ...
10
votes
2answers
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 ...
16
votes
0answers
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 ...
24
votes
17answers
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 ...
14
votes
9answers
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 ...
13
votes
5answers
473 views

Conway's $1(0),000 challenge

Background This challenge is about A004001, a.k.a. Hofstadter-Conway $10000 sequence: $$ a_1 = a_2 = 1, \quad a_n = a_{a_{n-1}} + a_{n-a_{n-1}} $$ which starts 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
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): ...
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 ...
16
votes
5answers
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. ...
2
votes
0answers
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 ...
1
vote
0answers
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, ...
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
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, ...
2
votes
0answers
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 ...
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
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, ...
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 ...
12
votes
0answers
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 ...
48
votes
28answers
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
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. ...
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
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 ...
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
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 ...
13
votes
6answers
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 ...
0
votes
0answers
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 ...
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
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://...
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
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 ...
10
votes
18answers
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 ...
2
votes
22answers
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'...
5
votes
1answer
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. ...
-1
votes
11answers
260 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. ...

15 30 50 per page
1
3 4
5
6 7
232