text
stringlengths
180
608k
[Question] [ ## Challenge: Given a positive number \$n\$, convert it to binary, and output a [sequence](/questions/tagged/sequence "show questions tagged 'sequence'") where all `1`s form a top-left to bottom-right diagonal line, including a leading column of `1`s. To give two examples: \$n=1\$ will result in `[1,3,...
[Question] [ # Challenge Given an integer `n` (where `4<=n<=10**6`) as input create an ASCII art "prison door"\* measuring `n-1` characters wide and `n` characters high, using the symbols from the example below. --- ## Example ``` ╔╦╗ ╠╬╣ ╠╬╣ ╚╩╝ ``` The characters used are as follows: ``` ┌───────────────┬────────...
[Question] [ # Definition * \$a(0) = 0\$ * \$a(n) = n-a(a(a(n-1)))\$ for integer \$n > 0\$ # Task Given non-negative integer \$n\$, output \$a(n)\$. # Testcases ``` n a(n) 0 0 1 1 2 1 3 2 4 3 5 4 6 4 7 5 8 5 9 6 10 7 11 7 12 8 13 9 14 10 15 10 16 11 1...
[Question] [ As a kind of part 2 to [Hello, World! (Every other character)](https://codegolf.stackexchange.com/questions/128496/hello-world-every-other-character?noredirect=1#comment319193_128496), write a program such that **all three** of these programs print "Hello, World!": the entire program, the 1st, 3rd, 5th...
[Question] [ Your task is to create a program that outputs the string: ``` Hello, Toroidal Earth! ``` with an optional trailing newline. Additionally if I remove the first line1 of your program and add it as a line after the end of your program the new program should be a valid solution to this challenge in the sam...
[Question] [ Your challenge is to take a name (string) as input, like ``` Albert Einstein ``` and output: ``` Einstein, Albert ``` ## Pseudocode: ``` set in to input set arr to in split by " " set last to the last element of arr remove the last element of arr set out to arr joined with " " prepend ", " to out prepe...
[Question] [ Given a non-empty string, keep removing the first and last characters until you get to one or two characters. For example, if the string was `abcde`, your program should print: ``` abcde bcd c ``` However, if it was `abcdef`, it should stop at two characters: ``` abcdef bcde cd ``` Trailing newli...
[Question] [ Your challenge is to exactly output the following box: ``` .................................................. .................................................. .. .. .. .. .. ++++++++++++++++++++++++++++++++++++...
[Question] [ Your task is to, given an array of signed 32 bit integers, recompile it with its inverse deltas. For example, the list ``` 1 3 4 2 8 ``` holds the deltas: ``` 2 1 -2 6 ``` which are then negated, yielding: ``` -2 -1 2 -6 ``` and recompiled, yielding: ``` 1 -1 -2 0 -6 ``` as the final result....
[Question] [ Given an ASCII string, output the exploded suffixes of it. For example, if the string was `abcde`, there are 5 suffixes, ordered longest to shortest: ``` abcde bcde cde de e ``` Each suffix is then *exploded*, meaning each character is copied as many times as its one-indexed location in that suffix. Fo...
[Question] [ This challenge, I hope, is simple to understand. Given a date-string (given in any format you prefer, **so long as it has 4 digits of year and 2 digits of day and month**), calculate the weekday for the particular date-string. You must output 7 different values, corresponding to the weekday you have ca...
[Question] [ You will be given two integers \$M\$ and \$N\$. Find the number of pairs \$(x,y)\$ such that \$1 \le x \le M\$, \$1 \le y \le N\$ and \$(x+y)\bmod5 = 0\$. For example, if \$M = 6\$ and \$N = 12\$, pairs which satisfies such conditions are, \$(1,4), (4,1), (1,9), (2,3), (2,8), (3,2), (3,7), (3,12), (4,6...
[Question] [ You have to make a game Too-low --- Too-high (TLTH) in shortest code (in bytes) ## Game rules: 1. Computer will choose a random number out of integer range (-32768..32767). 2. Now you will think of a number and input it. 3. The computer will tell if your number is lower (`TOO LOW`) or higher (`TOO HIG...
[Question] [ Given a string, shuffle it so that it becomes a palindrome. For example, `adadbcc` can be arranged into `dacbcad`, or `dcabacd`, `acdbdca` and more. Any of these (or all) is acceptable, and duplicates are allowed if outputting all. Something like `abc` cannot be shuffled into a palindrome, and you can ...
[Question] [ Although it's done a few times as sub-challenge of a larger challenge, and we also have [a challenge to remove the borders of a square matrix](https://codegolf.stackexchange.com/questions/154686/perfect-squares-without-borders), I couldn't find a challenge to output the borders of a given matrix, so he...
[Question] [ ## Challenge: Here we have the first 100 items of a sequence: ``` 6,5,4,3,2,1,66,65,64,63,62,61,56,55,54,53,52,51,46,45,44,43,42,41,36,35,34,33,32,31,26,25,24,23,22,21,16,15,14,13,12,11,666,665,664,663,662,661,656,655,654,653,652,651,646,645,644,643,642,641,636,635,634,633,632,631,626,625,624,623,622,6...
[Question] [ # Problem Let's say that a word is almost a **[palindrome](https://en.wikipedia.org/wiki/Palindrome)** if it is possible to remove one of its letters so that the word becomes a palindrome. Your task is to write a program that for a given word determines which letter to remove to get a palindrome. The s...
[Question] [ Yet another Brainfuck parsing problem, but this time... different. > > You are working in the Infinite Monkeys Incorporated, the company making Brainfuck programs, to solve various interesting problems (by accident, no less - after all, the company makes random programs). However, it appears that your...
[Question] [ Create a program which sums all integers found in a string which is set as a variable in the program (thus, the program doesn't have to handle any input). The integer numbers are separated by non-numericals (anything but 0, 1, 2, 3, ..., 9). Examples: * `e7rde f ,fe 43 jfj 54f4sD` = 7+43+54+4=108 * `5`...
[Question] [ # Average color of an image Scientists have been able to determine the average [color](https://en.wikipedia.org/wiki/Cosmic_latte) of the universe but in how many bytes can we find the average color on an image? ### Your task Your input will be a single image which you will need to find the average of ...
[Question] [ A [marquee](https://en.wikipedia.org/wiki/Marquee_(structure)) is a low-tech board that allows customizable letters. For example, here is a marquee: ``` SALE ON SNEAKERS ``` However, someone might come along and vandalize it by removing letters to send a different message: ``` S N AKE ``` Given ...
[Question] [ Your task is to accept as input two "ASCII Art"s, and align each piece of art next to each other horizontally. For example, say you have two strings, `"abc\ndef"` and `"123\n456"`. You need to align them horizontally to produce the string `"abc123\ndef456`". I'm calling this "aligning horizontally" bec...
[Question] [ 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 that doesn't break the [standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loop...
[Question] [ A biquadratic number is a number that is the fourth power of another integer, for example: `3^4 = 3*3*3*3 = 81` Given an integer as input, output the closest biquadratic number. Here are the first 15 double-squares: ``` 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, 14641, 20736, 28561, 38416, 506...
[Question] [ What general tips do you have for golfing in [Factor](http://factorcode.org)? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Factor (e.g. "remove comments" is not an answer). [Answer] # math.unicode this thing is a golfing jewel. <...
[Question] [ Given a list of `N` non-negative integers, output those numbers with each left-padded by spaces to a length of `N`. (Alternatively, return a character/string list.) **You may assume that `N` is greater than or equal to the number of digits of the largest number in the list.** Trailing spaces are allowe...
[Question] [ Suppose we have two different types of coin which are worth relatively prime positive integer amounts. In this case, it is possible to make change for all but finitely many quantities. Your job is to find the largest amount that cannot be made with these two types of coin. ## Task Input: A pair of rela...
[Question] [ # Winner: [Chilemagic](https://codegolf.stackexchange.com/a/37113/10961), a massive 21 bytes! You may continue to submit your answer, however you can no longer win. Original post kept: --- Your goal is to find all numbers in a string, and multiply each one individually by a value input by the user * Yo...
[Question] [ When I was younger, I had a big map of the US tacked up on my wall across from my bed. When I was bored, I would stare at that map and think about stuff. Stuff like the four-color-theorem, or which state bordered the most other states. To save younger me some brainpower in counting, you are going to ~~...
[Question] [ Lists can contain lists and we have nested lists. But we don't like nested lists and want to flatten them. By flattening I mean create a list which does not contain any list, but elements of lists it contained before. I'll explain it more. ## Input An arbitrary size list which has the below properties:...
[Question] [ Given a string, replace all left-double-quotes into two backticks and all right-double-quotes into two single-quotes. Left-quotes means the quotes that starts a quote. Right-quotes means the quotes that ends a quote. Quotes cannot be nested. You may assume that there are an even number of double-quotes...
[Question] [ [![enter image description here](https://i.stack.imgur.com/nhS8q.jpg)](https://i.stack.imgur.com/nhS8q.jpg) Normally, challenges are scored in bytes, or sometimes Levenshtein distance, but for this one we're using keyboard distance -- the number of keys between the keys used to type the program (use th...
[Question] [ ## Task The task is to write a program that outputs a consistent but otherwise arbitrary positive integer \$x\$ (so strictly greater than 0). Here's the catch: when the source is repeated \$N\$ times (the code is appended/concatenated \$N-1\$ to itself), the program should have a \$\dfrac{1}{N}\$ proba...
[Question] [ For this challenge you will print the coordinates and color of each piece at the start of a game of checkers. Enter the x and y (comma seperated) for every square (indexed 0-7) on a checkerboard, followed by a "r" or "b" (for red or black) where the top of the board (closer to y=0) is red and the bott...
[Question] [ You met a 4-th dimensional being who challenged you to a game of dice. The rules are simple: each player rolls 3 6-sided dice and takes the sum of each combination of 2 dice. The player with the highest sum wins. If the first-highest sum is a tie, consider the second-highest sum, and so on. Your oppone...
[Question] [ ## Background [**Fibonacci trees**](https://xlinux.nist.gov/dads/HTML/fibonacciTree.html) \$T\_n\$ are a sequence of rooted binary trees of height \$n-1\$. They are defined as follows: * \$T\_0\$ has no nodes. * \$T\_1\$ has a single node (the root). * The root node of \$T\_{n+2}\$ has \$T\_{n+1}\$ as ...
[Question] [ My previous challenge, [Print invisible text](https://codegolf.stackexchange.com/questions/122703/print-invisible-text) was quite popular, likely due to how trivial it is. However those more observant of you may have noticed that you're not really printing invisible text, because it's impossible to rea...
[Question] [ The challenge is to write codegolf for the [permanent of a matrix](https://en.wikipedia.org/wiki/Permanent). The permanent of an \$n\times n\$ matrix \$A = a\_{i,j}\$) is defined as $$\text{perm}(A) = \sum\_{\sigma \in S\_n} \prod^n\_{i=1} a\_{i,\sigma(i)}$$ Here \$S\_n\$ represents the set of all perm...
[Question] [ The [Binet formula](https://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression) is a closed form expression for the \$n\$'th [Fibonacci number](https://en.wikipedia.org/wiki/Fibonacci_number): $$F\_n = \frac {\phi^n - (1-\phi)^n} {\sqrt 5}$$ where \$\phi = \frac {1 + \sqrt 5} 2\$ is the [gol...
[Question] [ ## Task Given a list of integers **L** and another integer **s**, the goal is to compute the column-wise sums of all **s**-length (potentially overlapping) slices of **L**, while pertaining their positions relative to **L** (see below). ## Definitions The **s**-length *(overlapping) slices* of the list...
[Question] [ The dealer has been sloppy and lost track of what cards his/her deck contains and what cards are missing, can you help him/her? --- A complete deck consists of 52 playing cards, namely: Each color in the deck (hearts, diamonds, spades, clubs) contains: * The numbers [2 - 10] * A Jack * A Queen * A King...
[Question] [ Write a function or program that accepts one character (or a string of length 1) as input, and outputs the number of times that character occurs inside the code. * This program must be a [Proper Quine](https://codegolf.meta.stackexchange.com/questions/4877/what-counts-as-a-proper-quine), only in the se...
[Question] [ My two kids like to play with the following toy: [![Turtle](https://i.stack.imgur.com/BYhak.jpg)](https://i.stack.imgur.com/BYhak.jpg) The colored areas with the shapes inside can be touched and the turtle then lights the area and plays a sound or says the name of the color or the shape inside. The mid...
[Question] [ # The Task Given an input positive integer `n` (from 1 to your language's limit, inclusively), return or output the maximum number of distinct positive integers that sum to `n`. # Test Cases Let `f` define a valid function according to the task: The sequence for `f`, starting at 1: ``` 1, 1, 2, 2, 2, 3...
[Question] [ # Can the Tune be Played? ## Explanation A broken musical keyboard has keys labelled with positive integers. It is broken in two ways: 1. It takes a long time to process key presses: after pressing the key labelled with the number \$n\$, there is a gap of \$n\$ seconds before the \$n\$th note is heard....
[Question] [ # Super permutations Input: A string The program should loop through all lengths of the input (decrementing one each time), generate all combinations with replacement of the string, then make permutations out of the generated combinations, and display all of the strings. They can be separated with an...
[Question] [ The title pretty much describes it all. Given as input a \$n \times m\$ matrix and an integer \$i\$ create a complete function/program that returns the matrix \$i\$ times clockwise rotated by \$90^\circ\$. **Rules:** * as matrix you can use any convenient representation you like e.g. *a list of lists e...
[Question] [ This challenge is inspired by my earlier challenge "Create a program that prints the amount of characters it has, in words". This challenge's rules are simple: make a program that prints its character count, in words, which works in as many languages as possible. Each programming language the program w...
[Question] [ Find the maximum possible number of disjoint sets of characters, that are [Turing complete](https://en.wikipedia.org/wiki/Turing_completeness) subsets of your language. ## Rules: * You can assume your Turing complete subset is contained in/called from a main-function if that is required by your languag...
[Question] [ The height of a binary tree is the distance from the root node to the node child that is farthest from the root. Below is an example: ``` 2 <-- root: Height 1 / \ 7 5 <-- Height 2 / \ \ 2 6 9 <-- Height 3 / \ / 5 11 4 <-- Height ...
[Question] [ Your goal is to determine if a number is divisible by 3 without using conditionals. The input will be an unsigned 8 bit number from 0 to 255. Creativity encouraged! You are ONLY allowed to use * Equality/Inequality (`==`, `!=`, `>`, `<`, `>=`, `<=`) * Arithmetic (`+`, `-`, `x`) * Logical Operators (`!...
[Question] [ Given a sorted list of unique positive floats (none of which are integers) such as: ``` [0.1, 0.2, 1.4, 2.3, 2.4, 2.5, 3.2] ``` Evenly spread out the values that fall between two consecutive integers. So in this case you would get: ``` [0.333, 0.666, 1.5, 2.25, 2.5, 2.75, 3.5] ``` (I have truncated the...
[Question] [ CHALLENGE STATUS: **OPEN** Comment, open a PR, or otherwise yell at me if I'm missing your bot. --- Prisoner's dilemma ... with three choices. Crazy, huh? Here's our payoff matrix. Player A on the left, B on the top ``` A,B| C | N | D ---|---|---|--- C |3,3|4,1|0,5 N |1,4|2,2|3,2 D |5,0|2,3|1,1 ``` ...
[Question] [ Your task is to decompose a number using the format below. This is similar to base conversion, except that instead of listing the `digits` in the base, you list the `values`, such that the list adds up to the input. If the given base is \$n\$, then each number in the list must be in the form of \$k\tim...
[Question] [ When coding in Python, sometimes you want a multiline string within a function, e.g. ``` def f(): s = """\ Line 1 Line 2 Line 3""" ``` (The backslash is to remove a leading newline) If you try to actually print out `s`, however, you'll get ``` Line 1 Line 2 Line 3 ``` That's...
[Question] [ Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details. --- Fen is a magician Elf. He can cast spells on an array of numbers to produce another nu...
[Question] [ Given an infinite arithmetically-progressive¹ sequence, compute the minimum length of a prefix with a product divisible by 2^8. ## Sample cases & reference implementation [Here](https://tio.run/##fU/LDsIgELzzFZsmTQA5CD7SNOEbvOgH1NpGYoWm4vcjj0jaGDsXdnZ2ZhdlnOuhlvDs7N3csNLKMnjZbmQIPFrz1jbo20ibUIaZxNo2cB7...
[Question] [ Consider the following sequence: ``` 0 1 3 2 5 4 8 6 7 12 9 10 11 17 13 14 15 16 23 ... ``` Looks pretty pattern-less, right? Here's how it works. Starting with `0`, jump up `n` integers, with `n` starting at `1`. That's the next number in the sequence. Then, append any numbers "skipped" and that haven...
[Question] [ The program should take input the number, the start of the range and the end of the range, and output how many integers the number appears between the start and end of the range, **inclusive**. Both programs and functions are allowed. ## Example Inputs For example: ``` //Input example 1 3,1,100 //Input...
[Question] [ A number of programming languages construct large integers through 'concatenating' the digit to the end of the existing number. For example, [Labyrinth](https://github.com/m-ender/labyrinth), or [Adapt](https://github.com/cairdcoinheringaahing/adapt). By concatenating the digit to the end, I mean that,...
[Question] [ Ruby comes with a built-in REPL, which is quite handy. ![screenshot of IRB](https://i.stack.imgur.com/V7y6s.png) Your challenge is to crash it in the least amount of code! The definition of "crash" is "make it exit in an **unintended** way." This means `exit`, `quit`, `abort`, `irb_exit`, `irb_quit`, e...
[Question] [ Given 2 non-negative integers as input, output a non-negative integer that cannot be created through any mathematical operators on the 2 inputs. For example, given inputs `2` and `3`, `6, 0, 5, 1, 9, 8, 23, 2` are all invalid outputs. Operations that must be taken into account are: ``` Addition ...
[Question] [ A casino uses the following deck of cards. (`*` is one of the card suits `D`, `S`, `C` or `H`.) ``` _________ _________ _________ _________ _________ | | | | | | | | | | | | | | | * | | * * | | * * | | | ...
[Question] [ [Unary numbers](https://en.wikipedia.org/wiki/Unary_numeral_system) typically only represent nonnegative integers, but we can extend them to represent all integers as follows: * A positive integer N is represented as N `1`'s: `5 -> 11111` * A negative integer -N is represented as a `0` followed by N `1...
[Question] [ In the language [Nim](https://nim-lang.org "Nim programming language"), the rules for differentiating identifiers are [slightly more relaxed](https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality "Nim identifier equality") than most other languages. Two identifiers are equivalent o...
[Question] [ The task is to generate all the strings from 'a' to '999' including upper case characters like so: ``` 'a', 'b', 'c' ... 'y', 'z', 'A', 'B', 'C' ... 'Y', 'Z', '0', '1', 2' ... '8', '9', 'aa', 'ab', 'ac' ... 'az', 'aA', 'aB' ... 'aZ', 'a0' ... 'a9', 'ba' ``` and so on (filling in the gaps), optionally ...
[Question] [ Given a number \$n ‚â• 2\$, a [blackbox function](https://codegolf.meta.stackexchange.com/a/13706/100664) \$f\$ that takes no arguments and returns a random integer in the range 0...n-1 inclusive, and a number \$m ‚â• n\$, your challenge is to generate a random integer in the range 0...m-1 inclusive. Y...
[Question] [ You are playing a famous game called \$1\text{D Array BattleGround}\$. In the game, the player can be stationed in any position from \$0\$ to \$10^5\$. You are a *Paratrooper* in the game and have the ability to do *two types of operation* \$-\$ * ***Advance***, which would **multiply** your position b...
[Question] [ For a *positive* integer `n` with the prime factorization `n = p1^e1 * p2^e2 * ... pk^ek` where `p1,...,pk` are primes and `e1,...,ek` are positive integers, we can define two functions: * `Ω(n) = e1+e2+...+ek` the number of prime divisors (counted with multiplicity) ([A001222](http://oeis.org/A001222)...
[Question] [ # Introduction Sisyphus was having some troubles at work lately. It seems he just never gets anything done, and he would love to find a solution to this problem. His current employment requires rolling a rock up a hill. He usually does his job well, but every time he is near the top of the hill it roll...
[Question] [ Inspired by this: <http://nolandc.com/smalljs/mouse_reveal/> [(source)](https://github.com/NolanDC/smalljs/tree/master/mouse_reveal). A valid answer: * Takes a number \$w\$ and (assumed non-negative) integer \$x\$. * Starts with an integer list with a length of \$2^w\$, initially filled with zeroes. * ...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/223040/edit). Closed 2 years ago. [Improve this question](/posts/223040/edit)...
[Question] [ ## What is Permutation Coefficient Permutation refers to the process of arranging all the members of a given set to form a sequence. The number of permutations on a set of n elements is given by n! , where “!” represents factorial. The Permutation Coefficient represented by P(n, k) is used to represent...
[Question] [ [*The Bible*](https://en.wikipedia.org/wiki/Bible) is one of the most influential books ever written, and commonly cited as [the best selling book of all time](https://en.wikipedia.org/wiki/List_of_best-selling_books). It was written by approximately [40 different authors over hundreds of years](https:...
[Question] [ You have to write a program or a function in any language that outputs this pattern: ``` ~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||~ |~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||~| ||~|||||||||||||||||||||||||||||||||||||||||||||||||||||||~|| |||~||||||||||||||||||||||||...
[Question] [ # Task Write some code that can be rearranged into n different programs in n different languages each outputting a distinct number from 1 to n. No two languages should be the same however different versions of "the same language" will be considered distinct languages, as long as they have different maj...
[Question] [ **Input:** A positive integer ***n*** which is `1 <= n <= 25000`. **Output:** 1. In this sequence we start with the decimal number 1/***n***. 2. Then we take the sum of digits up until the ***n***'th digit after the comma (1-indexed); followed by the sum of digits up until the (***n***-1)'th, then (***...
[Question] [ This is a problem that the Hacker Cup team made for the 2018 Facebook Hacker Cup, but we ended up not using it (though Ethan struggles through [a](https://www.facebook.com/hackercup/problem/1153996538071503/) [variety](https://www.facebook.com/hackercup/problem/232395994158286/) [of](https://www.facebo...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/116012/edit). Closed 6 years ago. [Improve this question](/posts/116012/edit)...
[Question] [ I want a blanket that looks like this. Each strip goes over, under, over, under. Can you print it? ``` \\\\////\\\\////\\\\////\\\\////\\\\////\\\\//// \\//// \\//// \\//// \\//// \\//// \\//// //// //// //// //// //// //// ////\\ ////\\ ////\\ ////\\ ////\\ ////\\ ////...
[Question] [ In this challenge, the goal is to find the values of some variables after a number of assignments are done. An example input: ``` a = 5 b = 4 c = a = b a = 2 b = a ``` This would result in: ``` a = 2 b = 2 c = 4 ``` Each statement will be one of the following: * A variable name (`[a-z_]+`) * A numeric ...
[Question] [ # task Your task is to build a structure with \$n\$ cubes. The volume of cubes follow the following sequence (bottom *->* top) # \$n^3, (n-1)^3, (n-2)^3,...,1^3\$ # input The total volume of the structure (\$V\$). # output value of (\$n\$), i.e : The total number of cubes. \$V = n^3 + (n-1)^3 + .... +...
[Question] [ ## Background We've studied at least [five](https://codegolf.stackexchange.com/questions/205252/lets-study-neil-numbers) [different](https://codegolf.stackexchange.com/questions/205396/bubbler-numbers) [types](https://codegolf.stackexchange.com/questions/57882/is-this-a-candidate-calvin-number) [of](ht...
[Question] [ I have just tried a game called [Couch 2048](https://js13kgames.com/games/couch-2048/index.html). (Note: You should have a look to better understand this question.) Since it wasn't very exciting for me, I've been asking myself *'How much more till 2048!?'* That inspired me to post a challenge, be...
[Question] [ Problem A3 from [the 2008 Putnam competition](https://kskedlaya.org/putnam-archive/2008.pdf) says: > > Start with a finite sequence \$a\_1, a\_2, \dots, a\_n\$ of positive integers. If possible, choose two indices \$j < k\$ such that \$a\_j\$ does not divide \$a\_k\$, and replace \$a\_j\$ and \$a\_k\$...
[Question] [ A [parity bit](https://en.wikipedia.org/wiki/Parity_bit), is one of the simplest forms of a checksum. First, you have to pick the parity, even or odd. Let's say we pick even. Now, we need a message to transmit. Let's say our message is "Foo". This is written in binary as: ``` 01000110 01101111 01101111...
[Question] [ # The Task You are to write some ASCII Art Text as seen from [this website for generating ASCII art](http://patorjk.com/software/taag/#p=display&h=0&f=Alpha&t=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz)! # Rules Input will only be alphabetical text and spaces, and will be input as a single li...
[Question] [ ## Background We've had challenges before on [Fibonacci coding](https://en.wikipedia.org/wiki/Fibonacci_coding) and Zeckendorf representation. These representations follow naturally from [Zeckendorf's theorem](https://en.wikipedia.org/wiki/Zeckendorf%27s_theorem), which states that every positive integ...
[Question] [ 2019 has come and probably everyone has noticed the peculiarity of this number: it's in fact composed by two sub-numbers (20 and 19) representing a sequence of consecutive descending numbers. ### Challenge Given a number `x`, return the length of the maximum sequence of consecutive, descending numbers ...
[Question] [ # Challenge Given a binary number as input through any means, "simplify" the number using a full program or a function. # Input ``` [binary] ``` * `binary` is a number in binary that is over 0. # Output Take the input, convert it to base 10 without using a builtin, then if that number contains only 1s ...
[Question] [ [Powerful numbers](https://en.wikipedia.org/wiki/Powerful_number) are positive integers such that, when expressed as a prime factorisation: $$a = p\_1^{e\_1} \times p\_2^{e\_2} \times p\_3^{e\_3} \cdots \times p\_k^{e\_k}$$ all exponents \$e\_1, e\_2, ...\$ are greater than or equal to \$2\$. Note that...
[Question] [ Given a list of `N` integers, each with `N` digits, output a number which differs from the first number because of the first digit, the second number because of the second digit, etc. ### Example Given this list: ``` 1234 4815 1623 4211 ``` The number `2932`'s first digit is different from the first nu...
[Question] [ [Picolisp](https://picolisp.com) has a feature called "super parentheses": > > Brackets ('[' and ']') can be used as super parentheses. A closing bracket will match [all parentheses to and including] the innermost opening bracket, or [if there are no unmatched opening brackets] all currently open pare...
[Question] [ Inspired by and drawns from [Is this number Loeschian?](https://codegolf.stackexchange.com/q/88732/85527) > > A positive integer \$k\$ is a **Loeschian number** if > > > * \$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i\$, \$j\$ integers. > > > For example, the first positive Loeschian...
[Question] [ Write a program that takes in a string and spells that word out using the NATO Phonetic Alphabet. The mapping is as follows: ``` 'A' -> 'Alfa' 'B' -> 'Bravo' 'C' -> 'Charlie' 'D' -> 'Delta' 'E' -> 'Echo' 'F' -> 'Foxtrot' 'G' -> 'Golf' 'H' -> 'Hotel' 'I' -> 'India' 'J' -> 'Juliett' 'K' -> 'Kilo' 'L' ->...
[Question] [ Given a relation, and a domain, output whether the relation is an equivalence relation. ## Context For this challenge, a relation is defined as being a set of ordered pairs that is a subset of the cartesian product of a domain with itself. That is, \$R \subset X \times X\$. For a relation \$R\$ to be a...
[Question] [ ## Task Given a square array of 0s and 1s, determine whether or not there exists a path of 1s connecting the leftmost and rightmost columns. A path can take steps of one unit up, down, left or right, but not diagonally. Every symbol on the path must be a 1, and it must start somewhere in the first colu...
[Question] [ In the MMORPG Final Fantasy XIV, the Ninja class has the ability to use combinations of up to three handsigns (Ten, Chi and Jin) to perform a variety of ninjutsu skills. The skill you cast depends on the last sign used, and using two or more of the same sign makes the ninjutsu skill fail and [puts a li...
[Question] [ The goal is simple: **calculate the [totient function](http://en.wikipedia.org/wiki/Totient_function)** for as many numbers as you can in **10 seconds** and **sum the numbers.** You must print your result at the end and you must actually calculate it. No automated totient function is allowed, but bign...
[Question] [ # Goal The goal of this challenge is to produce a function of `n` which computes the number of ways to partition the `n X 1` grid into triangles where all of the vertices of the triangles are on grid points. # Example For example, there are 14 ways to partition the 2 x 1 grid, so `f(2) = 14` via the fo...