instruction stringlengths 34 53.1k |
|---|
Background
You work for the police force as a programmer.
A villain has planted a bomb in the city, luckily the police force has captured both him and the bomb. The bomb is really complicated to disarm, however it has a password input to disarm it.
The villain, being cocky, has told you that there was no way you'd find... |
An easy way to understand the unit n-dimensional hypercube is to consider the region of space in n dimensions that you can get if every coordinate component lies in [0, 1]. So for one dimension it's the line segment from 0 to 1, for two dimensions it's the square with corners (0, 0) and (1, 1), etc.
Write a program or ... |
We are all familiar with the Fibonacci sequence:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765
However, instead of, f(n) = f(n-1) + f(n-2) we'll be taking digital sum of the previous 2 entries.
The sequence should still start with 0, 1, after that the differences are rapid... |
This challenge is inspired by xkcd:
Challenge:
You'll simulate the copying a large file (1 Gigabyte). The transfer rate will vary between 10 kB/second to 100 MB/second.
Your task is to output the time remaining of the file transfer. The output should look like:
Time remaining: 03:12 (meaning it's 3 minutes and 12 s... |
At the opening scene of the Dark Knight rises, there is a rather awkward dialogue between a CIA agent and the villain Bane.
CIA agent: “If I pull that [mask] off, will you die?”
Bane: “It would be extremely painful…”
CIA agent: “You’re a big guy.”
Bane: “…for you.”
It’s unsure if Bane intends to say “painful for you”... |
OEIS has a variation (A111439) on Golomb's sequence. As in Golomb's sequence, A(n) describes how often n appears in the sequence. But in addition, no two consecutive numbers may be identical. While building up the sequence, A(n) is always chosen as the smallest positive integer that doesn't violate these two properties... |
One of the interesting aspects of gravity is that, as far as I'm aware, you can't just have stuff floating in midair.
However, it seems not everyone at the Association of Random Castle Builders is aware of this fact, leading to castles such as this one:
#
#
# # # #... |
Not entirely sure if this one or a similar challenge has already been posted, but here it goes anyway.
Write a program that takes a string as input and writes its trucated/summarized output form such that a specific sep (separator) is placed in the middle, removing the necessary characters of the original string so tha... |
TAS Golf
In the style of a tool-assisted speedrun with a code-golf twist, the goal of this challenge is to complete World 1-1 of the original Super Mario Bros game for the NES in your chosen programming language in as few bytes as possible, using only the in-game controller inputs in the format I'll describe below. Yo... |
Your task is to sort an array containing the strings "quarter", "dime", "nickel", and "penny" any number of times in no specific order and sort them so that they are in this order: quarter dime nickel penny (in other words, greatest to least monetary value).
Rules
Your program must take an array as input containing... |
Write a program that keeps track of the number of consecutive days it has been run.
The day resets at midnight (the local time of the computer on which the program is run).
If there is a day that the program is not run, the counter is reset to zero.
Every time the program is run, the counter should go up by one day ... |
A symmetric polynomial is a polynomial which is unchanged under permutation of its variables.
In other words, a polynomial f(x,y) is symmetric if and only if f(x,y) = f(y,x); a polynomial g(x,y,z) is symmetric iff g(x,y,z) = g(x,z,y) = g(y,x,z) = etc.
For example, x^2+2xy+y^2, xy and x^3+x^2y+xy^2+y^3 are symmetric pol... |
You're given a n-by-m matrix of integers, where n,m > 3. Your task is to find the 3-by-3 sub-matrix that has the lowest mean, and output this value.
Rules and clarifications:
The integers will be non-negative
Optional input and output format
The output must be accurate up to at least 2 decimal poins (if it's non-integ... |
Goal
This is a simple challenge. Your goal is to unscramble a string by swapping each letter with the next letter of the same case, while leaving non-letter characters unchanged.
Step by step explanation
The first character is a E. We look for the next letter in upper case: it's a C. We swap these characters, which l... |
Scrolling through social media, one might encounter something like this:
We can see that, following PEMDAS order of operations, the answer is clearly 11 9.
For the sake of this challenge, PEMDAS means that multiplication will occur before division, so a/b*c = a/(b*c), not (a/b)*c. The same goes for addition and subtr... |
Simple Mancala Game
Create a mancala game using as few bytes as possible.
The game
Mancala is a family of games where a player has a control over a set amount of pots filled with stones/seeds. The particular version which you should implement has a board with 14 pots, of which two are designated as scoring pots. At the... |
Write a program that creates a two-state checkbox that people can interact with using a mouse.
Specifically, your program should achieve all of the following:
Have a 8×8 pixel (or larger if desired) region of the screen that is the clickable area of the checkbox. Henceforth this region is simply called the checkbox.
... |
Your task is to write a program or function which:
When run for the first time, outputs its source code.
On subsequent executions, it should output what it output previously, but with one random character change (defined below). It does not have to be a uniformly random change, but every possible change should have a ... |
Create a function (preferably) or a program that takes an ordered collection and outputs the smallest possible palindrome that starts with the input.
For example:
>>> completePalindrome( [1, 2, 3] )
[1, 2, 3, 2, 1]
>>> completePalindrome( [1, 2, 3, 4, 5, 4, 3, 2] )
[1, 2, 3, 4, 5, 4, 3, 2, 1]
>>> completePalindrome( ... |
In mathematics an exclamation mark ! often means factorial and it comes after the argument.
In programming an exclamation mark ! often means negation and it comes before the argument.
For this challenge we'll only apply these operations to zero and one.
Factorial
0! = 1
1! = 1
Negation
!0 = 1
!1 = 0
Take a string of ... |
You're given a n-by-m matrix of integers, where n,m > 3. Your task is to find the 3-by-3 sub-matrix that has the lowest mean, and output this value.
Rules and clarifications:
The integers will be non-negative
Optional input and output format
The output must be accurate up to at least 2 decimal poins (if it's non-integ... |
We've all heard of the ol' Fizz Buzz problem, but what happens when you try to apply it with more factors? Fizz Buzz Crackle Pop!
The Challenge
Write a full program that takes an integer input n, then n tuples containing an integer and a string, then another integer (>1) k, as such:
n int1 str1 int2 str2 (...) intn st... |
A prime power is a positive integer n that can be written in the form n = pk where p is a prime and k is a positive integer. For example, some prime powers are [2, 3, 5, 4, 9, 25, 8, 27, 125].
Next, consider prime powers of 2. These are [2, 4, 8, 16, ...] and can be written in the form 2k. They would all be included wh... |
These are ASCII dandelions:
\|/ \ / |
/|\ | \|/ |
| | | _\|/_
| | | /|\
ASCII dandelions have three parameters: Length of the stem (positive number between 1 and 256, number of seeds (positive number between 0 and 7), and orientation (^ or ... |
Problem:
Your task is to write a program that takes as input a height (in meters) and weight (in kilograms), and outputs the corresponding BMI category.
BMI is a measure of the ratio of your weight to your height. It's dated and inaccurate for many people, but that doesn't matter here!
BMI can be calculated using the f... |
I only very recently discovered code golf and just found this part of the Stackexchange network, and naturally after looking at so many clever answers, I feel inferior. Inner me knows I'll get better over time, but inner me is also vain and needs validation.
At the same time, I don't take kindly to pandering, so you'd ... |
Write a quine, that when run, creates itself in the current directory, in a source file named itself. We will be using Windows in this, so the file name (and therefore quine) must have the following limitations:
None of these characters \ / : ? * < > |
Fewer than 211 255 characters
Limitations and assumptions
Your c... |
Feb. 6 was a real weekday. Because it lies in the 6th week of the year.
So a real weekday is a day with a a day number that equals the week number.
But not all country have the same counting of weeks. in Germany a week starts with Monday and ends on Saturday in the US they start on Sunday.
Write a program that checks a... |
Background
The 1-2-3-Tribonacci Sequence
Imagine for a second that you could make a fibonacci sequence by replacing the standard iteration formula with the following:
Basically, instead of summing the last two to get the next, you sum the last three. This is the basis for the 1-2-3-Tribonacci sequence.
Brown's Criteri... |
SmileBASIC deserves more attention. I've only seen 3 users here (including myself!) providing SB answers, and while that doesn't surprise me, it disappoints me. It being a paid lang as well as being a BASIC dialect certainly turns people off, but for those who own it it's actually pretty flexible and, surprisingly, gol... |
Take a positive integer n as input, and output (some of the) decimal numbers that can be created using n bits, ordered in the following way:
First list all the numbers that can be created with only one 1, and the rest 0 in the binary representation (sorted), then all the numbers that can be created with two consecutive... |
Rules
The program should receive a string/array of words as input. For each word in the string/array, it will reconstruct the word by taking characters in alternating fashion from the front and back of the word.
12345 678 9 -> 15243 687 9.
It will then rearrange the words in an alternating fashion between the earliest ... |
TikZ is a Latex package used for drawing precise images in Latex documents. It has a massive specification and a boatload of features that may be useful for graphical-output style questions.
What tips do people have for golfing in TikZ? As always, tips should be specific to to TikZ (e.g. "Remove comments" is not an a... |
In the location-based AR mobile game way of life Ingress the player can hack things called portals in order to get items. (If you are interested in Ingress, you can ping me in chat for more info. Trust me, it's better than Pokémon. If you end up downloading it, remember to choose the Resistance.)
A way to increase hack... |
EDIT: I'm getting a lot of comments about this not terminating - I will give the "correct answer" tag to either the first person who gives me FF(3) (as in provides it in their answer) or proves that FF(3) does indeed blow up indefinitely.
Task:
Your task is make the smallest program possible that generates the list of ... |
(I am not sure that this is the best place to put this question, but I will give it a shot. Forgive me if it is improper. This is just a fun project with which I am tinkering and I am looking for advice on how best to implement it; but it is also something of a 'challenge' (not implying that it is hard!), so I thought ... |
Input:
A maze containing the characters:
-- (horizontal wall);
| (vertical wall);
+ (connection);
(walking space);
I (entrance);
U (exit).
I.e. an input could look like this:
+--+--+--+--+--+--+--+--+--+--+
I | | |
+ +--+--+--+ + + + +--+ +
| | | | | |
+--+-... |
Introduction:
I'm a twisty puzzles collector. Here you can see my current collection of ± 300 puzzles.
I think everyone knows the regular Rubik's Cube (3x3x3 Cube), which is a NxNxN Cube. There are also Cuboids (block-shaped puzzles), which come in different forms, perhaps better explained by SuperAntionioVivaldi here:... |
Your task is to write a program or a function that prints an ASCII triangle. They look like this:
|\
| \
| \
----
Your program will take a single numeric input n, with the constraints 0 <= n <= 1000. The above triangle had a value of n=3.
The ASCII triangle will have n backslashes (\) and vertical bars (|), n+1 line... |
Your goal is to create an alphabet song as text in the following form (in order):
A is for <word starting with A>
B is for <word starting with B>
C is for <word starting with C>
...
Z is for <word starting with Z>
Example output:
A is for Apple
B is for Banana
C is for Carrot
D is for Door
E is for Elephant
F is for F... |
Intro
Something I've played around with in recreational mathematics has been construction of a divisor table to visually compare/contrast the prime divisors of a set of numbers. The set of input numbers are across the top as column labels, the prime divisors are on the left as row labels, and a mark indicates where the... |
The challenge
You are given an integer n, and you have to use these operations to make it 1.
Divide it by 3.
Divide by 2.
Subtract 1.
Examples:
Input Output
1 0 (Its already 1, guys)
5 3 (3->2->2 or 3->3->1)
10 3 (3->1->1)
255 10(3->3->3->1->1->2->2->3->1->2)
|
You will need to generate the smallest prime with n digits, and it will only contain digits specified in the list k.
Examples:
Input:
4
1 2
For this, you must generate the smallest prime with 4 digits, and that prime must only contain the digits 1 and 2.
Output:
2111
Input:
10
0 4 7
Output:
4000000007
Input:
6
5 5... |
Underload is a stack-based semi-functional tarpit created by ais523. I've recently been trying to golf in it, as it's a surprisingly elegant language.
What tips do you have for golfing in Underload? (One tip per answer)
|
A simple but hopefully not quite trivial challenge:
Write a program or function that adds up the kth powers dividing a number n. More specifically:
Input: two positive integers n and k (or an ordered pair of integers, etc.)
Output: the sum of all of the positive divisors of n that are kth powers of integers
For examp... |
You know it: keyboard or mouse input is just too mainstream to create Random Numbers through human behavior.
Create the most unique (Pseudo)Random Number Generator that create its numbers through human behavior.
Web-API's are not restricted! Anyone should use the code provided, so any special hardware is restricted. (I... |
Write a program or function that draws a tree of trees, thus constructing a forest.
The trees are drawn like stacking a pyramid. The first (top) row contains 1 tree, the next row down contains 2 (for a total of 3), the next contains 3 (for a total of 6), and so on. If there aren't enough trees to complete a full row, f... |
Background
I was inspired by 3Blue1Brown's recent video about the necklace splitting problem (or as he calls it, the stolen necklace problem) and its relationship to the Borsuk-Ulam theorem.
In this problem, two thieves have stolen a valuable necklace consisting of several different types of jewels. There are an even n... |
Find the outcome of a game of War
When I was in elementary school, there was a "Rock-Paper-Scissors"-ish game we'd play during assemblies, when waiting for our teacher, at recess etc. We called it "War". After some searching however, it turns out this is a much simpler variant of the "Shotgun Game" (according to WikiHo... |
I did the IMC this year. Did anyone else here do it?
In a UKMT Intermediate Maths Challenge paper, there are twenty-five questions. The first fifteen questions give you five marks if you get them right. For the other ten questions, you get six marks for getting them right. In the last ten questions, you lose marks if y... |
Inspired by this challenge (or, more specifically, by misreading it), I've come up with the following challenge:
Given an input string S, reverse the order of all uppercase characters, and all lowercase characters. Leave all non-letter characters in place. For instance:
Note that the uppercase W (the first uppercase l... |
In 2015 the Portland International Airport began the replacement of their iconic carpet. I want you to write a program to draw their old carpet in as few bytes as possible.
The carpet:
Specifications
Here is a link to a scalable pdf image of one tile. Your output should match the relative dimensions and placement o... |
First puzzle from me, suggestions for improvement gladly received!
The scenario is;
You work as a manager for a whitewater rafting company. Every morning, you are given a list of bookings, and you have to sort them into raft loads. Write a program or function in your chosen language that does this for you.
Each raft ho... |
Mama Say Mama Sa Mama Coosa
I'm sure all of you have heard of Michael Jackson and some of you have listened to MJ's song "Wanna be starting something". The line "Mama Say Mama Sa Mama Coosa" is repeated throughout the song.
Specification
In this line, the word "Mama"occurs three times, "Say", "Sa", "Coosa" occurs once... |
On a recent episode of QI, the first 5 multiples of 142857 were described as anagrams of the original number. Of course, anyone with more than a passing knowledge of that number will know that those numbers are actually cyclic, not just anagrams. But that got me thinking.
Please write a program or function that outputs... |
Goal:
Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.
Example solutions (TI-Basic):
A+B+1
not(A+B)
Invalid solutions:
A+B-1 (for inputs 0,0, it returns -1, which is not natural)
"ABC" (ABC is not a number)
Notes:
The output... |
Animate the text in your terminal
The goal
The goal is to "animate" the string "Hello world" in your output so that each character gets capitalised after each other.
Your program can exit after each letter has been capitalised.
For example;
# Iteration 1
Hello world
# Iteration 2
hEllo world
# Iteration 3
heLlo worl... |
Your challenge is to draw/plot one of the hearts below. The size must be at least 50x50 pixels (vector graphics is OK). You may choose which of the hearts you want to draw/plot. Axes, grid lines etc. are accepted. There must be at least 100 distinct coordinates/points on the graph. The heart can be filled with color if... |
Here's one generalized version of the famous Eight Queen's Puzzle:
Given an n × n chess board, and an integer m (≤ n). Find all possible ways to put nm Queens such that
there are m Queens at each row
there are m Queens at each column
(note that we do not impose any restriction on the diagonals).
As you might see, ... |
This is a cops-and-robbers challenge. For the robbers thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The Cops' Challenge
Your challenge as a cop is to pick a freely available language, and two OEIS sequences. Then, w... |
This is a cops-and-robbers challenge. For the cops thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The cops are constructing code A that produces S1 and giving a number X that they claim is the best Levenshtein distan... |
Your task will be to take a balanced-string and a integer representing a Levenshtein distance (the number of characters that have to be inserted, deleted or changed to make one string into another) and you must find the number of balanced strings with that distance from the original string (i.e. the neighborhood of tha... |
Background
Suppose that there are 2*n people to be married, and suppose further that each person is attracted to exactly n other people under the constraints that:
Attraction is symmetric; i.e. if person A is attracted to person B, then person B is attracted to person A.
Attraction is antitransitive; i.e. if person A ... |
The challenge
Your task is to decode the first character in a UTF-8 byte sequence. The input is a byte array or a byte string holding a UTF-8 byte sequence.
If the (start of the) sequence is valid, the output is the Unicode code point of the first character in the sequence which is a number between 0 and 0x10FFFF. Your... |
Right hand brace is a style of code bracketing in which curly braces and semicolons are all aligned to a single point on the right side of a a file.
Generally, this is considered bad practice, for several reasons.
The Challenge
Take a multiline string through any method, and convert it's brace style to Right Hand Brac... |
The lambda calculus is a system of functional programming. Lambda calculus consists of variables, abstractions, and applications.
A variable is simply a name denoting a function parameter. It is a single letter. An abstraction is a "function literal" of sorts, it consists of a backslash \ followed by a variable name, a... |
Inspired by this challenge
Goal:
The goal is to draw waves crashing onto a beach.
Input:
You will be given 3 integers (in whatever format you want) as input.
The first integer will be the length of the drawing
The second integer will be the index of the sandbar, where the waves start to crest (at least 3 spaces from ... |
Sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, as represented in the following figure from Wikipedia:
Attack time (A): time taken for the envelope to reach its maximum... |
Your task is to write a program that:
Runs indefinitely
Produces no output
Consumes an unbounded amount of memory
Specifications
You must list the implementation used for your program. This is relevant because some implementations might preform optimizations while others do not. For example, the LISP code (defun f (... |
A Woodall Prime is a prime which can be calculated, given a positive integer n, with n * 2^n - 1.
Your task is to, given a integer k, generate a Woodall Prime with k digits. If no such Woodall Prime exists, you must generate a Woodall Prime with the closest amount of digits. If two primes exist with the same digit coun... |
Your task is to find how many distinct Blackjack sequences can be found in an ordered list of 12 cards.
A Blackjack sequence is defined as a sequence of consecutive cards whose sum of points is exactly 21. Points are counted according to the following table:
Symbol | Name | Points Symbol | Name | Points
-------+-... |
This is a cops-and-robbers if you are not familiar with the format click the tag to go to the wiki. There will not be a robbers' thread for this question.
Cops
Your task as Cops is to select two sequences from the Online Encyclopedia of Integer Sequences and write a program that takes the nth element of one sequence a... |
This challenge is to output to your terminal, window, canvas or screen the numbers zero to 10 inclusive. Each outputted number must be shown as a 4-bit wide nybble, so zero must show as 0000 and so on.
You may separate each number outputted with a space, comma or carriage return. Smallest solution wins but the numbers ... |
I'm a developer, and I don't feel like doing my work. I know from XKCD that the best excuse for slacking off is that your code's compiling. Because of this, I think I need some code that will compile forever! And because I'm lazy and don't want to have to type much, this has to be done with the shortest code possible.
... |
Gray Code is a number system where only 1 bit of the number changes from one number to the next number. Print the 8 bit Gray Code values of 0 to 255.
Shortest Code wins!
Start of output:
0 00000000
1 00000001
2 00000011
3 00000010
4 00000110
5 00000111
6 00000101
7 00000100
...
You only have to print the Gra... |
Input
A string that contains at most one of each of the letters A, B, and C. They may be in any order. The empty string is valid input.
Note: A previous version of this challenge used the letters LEJ instead of ABC and they may still be used if desired.
Output
A string of the A, B, C letters that were not present in th... |
Objective
Given an input list of 6 distinct digits, find 3 numbers a, b and c such that a × b = c, with a having 2 digits, b having 1 digit and c having 3 digits. In a more visual way, your program must arrange those 6 digits in the boxes of this image:
If more than one solution exists, you may output any of them.
Inp... |
The task
Write a program or function that given three strings A, B, C produces an output string where each instance of B in A has been recursively substituted with C.
Recursively substituting means repeating a substitution where at each step all non-overlapping instances of B in A (chosen greedily from left to right) a... |
Challenge:
Create a function or program that will take an input N (a number from 0 - 24) which represents the HOUR.
Output should draw an analog clock out of asterisks showing the hour N.
Notes:
•The minute hand must be longer than the hour hand (in terms of number of asterisks used)
•The minute hand must be at least... |
AWG (American Wire Gauge) is a common way of specifying wire sizes. Your task in this challenge is to convert from a given gauge to the diameter of the wire in inches.
The size in inches for the gauges from 4/0 to 40 are shown in the table below:
Gauge to inches table
| AWG | Diameter (Inches) |
|-----|----------------... |
A Graceful Graph is a type of Simple Graph. Graceful graphs are special because there is a way to label all their nodes with positive integers so that when the edges are also labeled with the differences of the nodes they connect, no two edges have the same label and every label up to the number of edges is used.
Work... |
I find NullPointerException to be interesting since there are no explicit pointers in Java. Here is a program that throws such an exception.
class c {
public static void main(String[]s) {
throw new NullPointerException();
}
}
What is the shortest Java program that throws NullPointerException?
|
Make a function, method, program or routine that will accept two interger parameters (say x and y) and the total of the two values multiplied. Except straight multiplication is not allowed so you must not simply do something like:
int multiply (int x, int y) {
return x*y;
}
Also you must not use a for () loop, lik... |
Inspired by this listing from the Commodore 64 User's Guide:
10 PRINT "{CLR/HOME}"
20 POKE 53280,7 : POKE 53281,13
30 X = 1 : Y = 1
40 DX = 1 : DY = 1
50 POKE 1024 + X + 40 * Y, 81
60 FOR T = 1 TO 10 : NEXT
70 POKE 1024 + X + 40 * Y, 32
80 X = X + DX
90 IF X <= 0 OR X >= 39 THEN DX = -DX
100 Y = Y + DY
110 IF Y <= 0 OR... |
This challenge is inspired by Mathematics is fact. Programming is not.
The mathematical notation for a factorial, or a fact is an exclamation mark !. The exclamation mark is also a common symbol for not in many programming languages.
Challenge:
Take a string, containing numerals, and the characters: + ! as input and o... |
Objective
Generate the original scrambled list, from the movements that an Insertion Sort would do to sort it.
The original list will have all numbers from 0 to N-1(inclusive) where N is the size of the input.
Input
A list containing the necessary moves to sort the list. Each value represents the amount of slots displa... |
Here's a scenario:
A grandmother and grandfather forget what their GMail password is. They know the word, but can't remember which letters are capitals.
The challenge is to take a word given and print(stdout) every combination of capital letters possible, essentially "brute-forcing" but only on a given string.
Example... |
In any programming language, create a program that takes input and animates the text being typed on a keyboard.
The delay between each character should be varying to simulate true typing on a keyboard. The delay shall be 0.1, 0.1, 0.5, 0.1, 0.1, 0.5 ... seconds, until the last character is printed. The final output sha... |
The Euclidean algorithm is a widely known algorithm for calculating the greatest common divisor (GCD) of two positive integers.
The algorithm
For the purpose of this challenge, the algorithm is described as below:
Display the two input as adjacent lines of a certain character
e.g. an input of 3,4 can be represented by... |
The first Predecessor-completed Ascii Cube (PAC 1) is a simple cube with side length 1 and looks like this:
/////\
///// \
\\\\\ /
\\\\\/
The PAC 2 is a geometric shape such that combining it with its predecessor (the PAC 1) completes a side length 2 cube:
front back
/////////\ /... |
Your task is to write code that will leak at least one byte of memory in as few bytes as possible. The memory must be leaked not just allocated.
Leaked memory is memory that the program allocates but loses the ability to access before it can deallocate the memory properly. For most high level languages this memory ... |
Background
Consider a sequence defined as follows:
The first element is 0;
The second element is 4;
From the third element onwards, its value can be calculated by:
Taking the set of integers from 0 up to the previous element of the sequence (inclusive or exclusive, it doesn't matter);
Removing any integers that have... |
Summary
The goal of this challenge is to create an undone image-version of a 15-puzzle / sliding puzzle also called taquin in french.
Details:
Given an input composed of:
an image,
an integer n,
an other integer r,
your program, or function, or anything else that fits, must output the same image (i.e. same size and f... |
There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair competition under our modern rulesets.
Background
A palindrome is a string that "reads the same forwards and backwards", i.e... |
Given two integers greater than one, A and B, output four mathematical expressions in this order:
The plain expression A^B (A to the power B). e.g. if A = 2 and B = 3, 2^3.
The expansion of A^B in terms of repeated multiplications of A. e.g. 2*2*2.
The expansion of A^B in terms of repeated additions of A. e.g. 2+2+2... |
Introduction
According to the Riemann Hypothesis, all zeroes of the Riemann zeta function are either negative even integers (called trivial zeroes) or complex numbers of the form 1/2 ± i*t for some real t value (called non-trivial zeroes). For this challenge, we will be considering only the non-trivial zeroes whose ima... |
Inspired by Expand exponentation.
Knuth's up arrow notation is used for big numbers such as Graham's number.
If we look deeper, we can see how it makes big numbers.
One arrow means exponentiation. e.g. 2↑3 equals 2^3 = 8.
Two or more arrows means repeating the instructions of n-1 arrows. e.g. 2↑↑3 equals 2↑2↑2 equals 2... |
Summary:
For any given language, what is the smallest amount of unique characters for your language to be Turing-Complete?
Challenge:
For any language of your choice, find the smallest subset of characters that allows your language to be Turing-Complete. You may reuse your set of characters as many times as you want.
... |
An Abundant number is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are:
1, 2, 3, 4, 6
And summing these results in 16. Since 16 is larger than 12, 12 is abundant. Note that this does not include "Perfect numbers", e.g. numbers that are equa... |
You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way ont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.