instruction stringlengths 34 53.1k |
|---|
This contest is over.
Due to the nature of cops-and-robbers challenges, the cops challenge becomes a lot easier when the interest in the associated robbers challenge has diminished. Therefore, while you can still post hash functions, your answer will not get accepted or form part of the leaderboard.
This challenge is... |
This contest is over.
There are no remaining crackable answer in the cops challenge.
Companion thread of Cryptographic hash golf
As a reminder, here are the rules for robbers from the main challenge:
Task
Crack any of the cops' submissions by posting the following in the
robbers' thread: two messages M and N in I ... |
A Young diagram is an arrangement of boxes in left-justified rows and top-justified columns. For each box, all the spaces above it and to its left are occupied.
XXXXX
XXX
XXX
X
The hook length of a box is the number of boxes to its right in its row, and below it in its column, also counting itself once. For example, t... |
We've been twice challenged to make 'error quines' (see Make an error quine! and Make a slow error quine maker!), so why don't we try the opposite?
Instructions
Write a "program" that, when run, produces an error.
Copy the error message into a new program, and run it.
Repeat Step 2 until the program runs without produ... |
I have noticed that there are a disproportionate number of computer languages based on English. I propose to fix this by translating existing computer languages into foreign languages!
Pick a computer language that uses English keywords/functions
Pick any natural* language other than English
Write a program that trans... |
Your job is to replace the battery packs on many floating fish tracking
devices in the shortest time. You must leave your base in the base helicopter
and visit each tracker once, then return to the base.
Finding the optimum route is known to be hard, but there is an additional
difficulty! Each tracker has a drift veloc... |
We all love horoscopes, don't we? But I have a serious problem in this Horoscope App installed on my Smart Phone that it only displays the icon of the Zodiac Sign for each day's horoscope. Now, I do remember my horoscope, but its hard to remember others' whose horoscope I am interested in.
Challenge
So here is your cha... |
Introduction
The number 101 is a palindrome, since it reads the same backwards and forwards. The number 105 is not. However, 105 in base eight is written as 151, which is palindromic. On the other hand, 103 is not a palindrome in any base from 2 to 101. Hence, 103 is strictly non-palindromic.
The precise definition is:... |
Another XKCD inspired competition.
This one is based on Keyboard Mash.
Given a input string, identify the anomalous characters, assuming that the majority have been typed on a single row of the standard US QWERTY keyboard.
Input strings can contain shifted key strokes, but they will not contain carriage returns (Enter)... |
I made a joke the other day and sent it to some friends. One replied back "I love the irony!" and I looked at it and realized there was some irony in it. But that wasn't the irony she saw - the irony she was was the punchline of the joke, which wasn't ironic in the slightest.
And it got me thinking about a certain othe... |
Please excuse the punny title.
This is a question is inspired by A Curious Property of 82000. In it, the author points out that the number 82000 is binary in base 2, 3, 4, and 5. The post then poses the question "is there a number that is binary in bases 2, 3, 4, 5, and 6"? (For those curious, I've checked values ... |
My teacher always gives me the most complicated set of math problems for homework. Like: pg. 546: 17-19, 22, 26, pg. 548: 35-67 odd, 79, 80-86 even. And I want to know in advance how much time to set aside for my homework, but I don't want to have to figure all that out. That's why its your task to program it for me.
S... |
Here are five images of pears and a steel chute:
A: B: C: D: E:
These are only thumbnails, click them for full size!
(I made these with Algodoo.)
This class of images always has the following properties:
They are always 400×400 pixels with a white background. (It may not be exactly white since SE images are lossily ... |
I like to save time quite literally, by wearing three watches on my wrist... Problem is they each give a different time. One watch is x minutes behind the actual time. One watch is x minutes ahead of the actual time. The last watch shows the actual time.
Problem is, I can't tell which watch has the correct time...
Fro... |
Mash Up Time!
This is instalment #5 of both my Random Golf of the Day and Optimizer's ASCII Art of the Day series. Your submission(s) in this challenge will count towards both leaderboards (which you can find the linked posts). Of course, you may treat this like any other code golf challenge, and answer it without worr... |
You should write a program which receives two strings as input and outputs a sequence of movements which rearrange the first string into the second. You should use as few moves as you can.
Both strings will contain only lowercase letters and the second (goal) string is a permutation of the first (original) one.
Every m... |
RoboCritters (etymology) is a brand new esoteric programming language (don't bother searching for it, I just invented it). It's a variant of Brainfuck (BF), slightly more complex than the usual operator substitution schemes. Every program in RoboCritters is a rectangular grid of text that only contains the seven charac... |
COMPLETE
Wumpus season has ended, and with, the lives of many a vicious Wumpus and brave Hunter. As well as some cowardly, immoral and downright stupid Hunters. But at the end of the day, NascarHunter by Dr Heckle came away with the most loot and glory. We salute you, oh brave... driver?
It's open season on Wumpuses, a... |
This isn't as much a "challenge" as "a unique problem that there are no built-in functions to solve." Basically, you need to do this:
Read some lines of numbers from stdin. These lines may contain trailing or preceding whitespace, and there may be empty lines. No lines will contain "just whitespace" other than a newli... |
Introduction
This challenge is about three (bad) sorting algorithms: Bogosort, and two others variants that I came up with (but have probably been thought of by others at some point in time): Bogoswap (AKA Bozosort) and Bogosmart.
Bogosort works by completely shuffling the array randomly and checking if it becomes sor... |
Have a look at this ascii art diagram of various boxes:
+--------------------------------------------------------------+
| |
| +-------------------------------+ +-------+ |
| | | | | |
| ... |
Write a program that takes one integer input n and one format letter and outputs n autograms in the format This sentence contains ? "A"s, ? "B"s ... and ? "Z"s.
Each question mark ? represents the number of times the the following letter appears in the text
All numbers will be written as text. To make it equally unfai... |
I promise, this will be my last challenge about diamong tilings (for a while, anyway). On the bright side, this challenge doesn't have anything to do with ASCII art, and is not a code golf either, so this is actually completely different.
So just as a reminder, every hexagon can be titled with three different diamonds:... |
The goal of this challenge is to (eventually) output every possible halting program in a language of your choice. At first this may sound impossible, but you can accomplish this with a very careful choice of execution order.
Below is an ASCII diagram to illustrate this. Let the columns represent a numbering of every ... |
Introduction
Partly inspired by this StackOverflow question, let's draw an ASCII Lightning Bolt.
Write a program that takes a positive Integer n via STDIN or command line and outputs the ASCII Lightning Bolt below.
Input
Positive Integer n representing the number of lightning zig-zag tiers to draw.
Example Output
n=1
_... |
The challenge is this:
You are given a url that is as follows:
http://sub.example.com/some/dir/file.php?action=delete&file=test.foo&strict=true
There can be either http or https, there can be any number of subdomains or directories, and the end file can have any name.
You are to create a full program (that can be comp... |
Introduction
Hex is a strategy board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus. Other popular dimensions are 13×13 and 19×19 as a result of the game's relationship to the older game of Go. According to the book A Beautiful Mind, John Na... |
Write a program that takes in a string of the four characters ()[] that satisfies these points:
Every left parenthesis ( has a matching right parenthesis ).
Every left bracket [ has a matching right bracket ].
Matching pairs of parentheses and brackets won't overlap. e.g. [(]) is invalid because the matching brackets ... |
In this challenge, you have to implement a basic spell checker and autocorrector. Your program will use the first input as a source for a dictionary of words, and will use that to autocorrect the second input, finding a close match to some incorrectly spelt words, outputting the result
Specifications
You will receive ... |
Here is a list of 1000 basic English words. Yes, I'm aware that there are only 997 words in the list! It was taken from Wiktionary so blame them!
Your task is to write a program that accepts a word and returns TRUE or FALSE (or 0 or 1) depending on whether the word is in the list or not. You must use the spelling as it... |
What general tips do you have for golfing in sed? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to sed (e.g. "remove comments" is not an answer).
Please post one tip per answer.
|
Consider the following standard 15×15 crossword puzzle grid.
We can represent this in ASCII art by using # for blocks and (space) for white squares.
# #
# #
#
# #
### ## ##
## #
# #
# ##
## ## ###
# #
# ... |
When working on Non-Palindromic Polyglot Boggle, I found it quite tedious to pack the codes as efficiently as possible onto the Boggle board, even with only two strings. But we're programmers, right? We know how to automate things.
Given a list of strings, you're to generate a Boggle board on which each of those string... |
Liar's Dice is a fairly simple dice game. I've seen a few different variations of the rules, but here is the version I'm most familiar with:
Each player starts with 5d6
Except when tallying the dice at the end of a round, each player may see their own dice, but not those of any opponent
At the start of any given round... |
Aim
If you are given a sequence such as (A, G, M, _, _, C, D, _, G) your aim is to push all non empty elements to one side to get (A, G, M, C, D, G, _, _, _). You must preserve the order of the non-empty elements.
Rules
You are free to choose the sequence type. (strings, numbers, containers etc). You must also choose ... |
Remember those fun pinwheels that you blow on and they spin round and round? Let's code one!
A pinwheel will have the set of characters \ | / _ drawing its center and arms. One possible pinwheel could look like this:
|
|
|_ ___
___|_|
|
|
|
But what's a pinwheel that doesn't spin? No fun... |
There is a nice way to perform long multiplication for two integers without having to do anything but counting, which occasional gets shared around the internet. You write the digits of each number as a bunch of slanted lines, with the two numbers at a 90 degree angle. Then you can simply count the intersections in the... |
Background
The Burrows–Wheeler transform (BWT) is a reversible permutation of the characters of a string that results in large runs of similar characters for certain types of strings such as plain text. It is used, for example, in the bzip2 compression algorithm.
The BWT is defined as follows:
Given an input string suc... |
In this challenge you will write a program that takes two newline-separated strings, s1 (the first line) and s2 (the second line), as input (STDIN or closest). You can assume that the length of s1 will always be smaller than 30 and bigger than the length of s2. The program should then output each step in the levenshtei... |
This task is about writing code to compute a probability exactly. The output should be a precise probability written as a fraction in its most reduced form. That is it should never output 4/8 but rather 1/2.
For some positive integer n, consider a uniformly random string of 1s and -1s of length n and call it A. Now con... |
The Hourglass
This hourglass has 60 "sands of time", and it completely fills each chamber. The clock is 19 characters wide and 13 characters in height. Each chamber has 5 rows of sand and there is a row in the centre that can hold 1 sand. The top row can hold 17 sands, the next one 15 and so on (see below). Sands fall ... |
Goal:
The goal of this challenge is to take a simple 6 row by 6 column XML file (without the standard XML header) and parse it out so that the program can return the value of a cell given it's coordinates.
The entry with the shortest overall length by language and overall will be declared the winner.
Additional informa... |
[This is a partner question to Calculate a probability exactly ]
This task is about writing code to compute a probability exactly and quickly. The output should be a precise probability written as a fraction in its most reduced form. That is it should never output 4/8 but rather 1/2.
For some positive integer n, consid... |
You have a 3x3 grid. Each cell can be colored black or white. Display all 512 of these colorings. Fewest bytes wins.
You can display the grids in any formation as long as they are visually separated and the spacing looks regular. You may use ASCII art or images. Any two distinct visible symbols or colors can be used fo... |
Write a program that takes in a non-empty string of the digits 0 through 9 and prints how they would be shown on a seven-segment display using slashes (/, \).
These are the precise digit shapes:
/\
\ \
\/
\
\
/\
/
\/
/\
/\
/
\
\/\
/
\/\
/
/
\/\
\/
/\
\
/\
\/\
\/
/\
\/\
/
When one digit oc... |
Imagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows.
The first item can be placed on any square, but subsequent items must not be within a Manhattan distance R of any previous item (also known as a Von Neumann neighbourhood of range R). Carefully choosing the positions allo... |
A common optimization to save space in binaries is to merge string literals where one literal is the suffix of another. For instance, a binary with the string literals
a: foobar
b: bar
c: barbaz
d: foobarbaz
e: baz
might contain the following string literal pool (# representing the \0-terminator):
foobar#foobarbaz#
w... |
It was a warm summer evening...
when my stupid car decided to break down in the middle of the road on my way back from the supermarket. I pushed it to the sideline and decided to walk home. I opened the trunk to take out the grocery and remaining stuff. It was then that I noticed the items were not evenly bagged. Some ... |
Introduction
In the error outputs of some languages such as Java, a pointer is shown to give the programmer an idea of exactly where the error went wrong.
Take this example on Ideone:
Main.java:12: error: ';' expected
Invalid Java!
^
Notice the caret shows where the invalid code is?
Challenge
Your... |
Randall Munroe's book "xkcd, volume 0" uses a rather odd number system for the page numbers. The first few page numbers are
1, 2, 10, 11, 12, 20, 100, 101, 102, 110, 111, 112, 120, 200, 1000, 1001, ...
This looks a bit like ternary, but notice that he skips from 20 straight to 100, from 120 to 200 and from 200 to 1000... |
In Minecraft, the default item textures are all reasonably simple 16×16 pixel images, which makes them seem ideal for golfing.
Below are simplified textures of the five "core" diamond tools in Minecraft: pickaxe, shovel, axe, sword, and hoe.
The images shown are enlarged to show their detail. Click on an image to view ... |
Your task is to generate boxes using any one ASCII character with respect to the inputs given.
Test Cases
1 1 --> =====
= =
=====
1 2 --> =========
= = =
=========
2 1 --> =====
= =
=====
= =
=====
2 2 --> =========
... |
Your task is to determine whether a graph is planar.
A graph is planar if it can embedded in the plane, or in other words if it can be drawn without any crossing edges.
Input: You will be given an undirected graph in your choice of the following formats:
Edge list, e.g. [(0, 1), (0, 2), (0, 3)]
Adjacency map, e.g. {0:... |
You should complete four tasks in a language which:
must return no results* when searched for on this (codegolf.se) website, for example ToffeeScript;
must have a page listed at Esolang, Rosetta Code or Wikipedia;
be a distinct language, rather than a distinct version (e.g. python 2.1 would be valid iff python satisfi... |
Introduction
Lately, I've been getting used to typing with Swype.
I've noticed certain words can be produced by drawing a straight line from your starting letter to your ending letter, or by skipping letters that repeat.
For example, I can type the word balloon by Swyping across the following letters:
b > a > l > o > n... |
Welcome back! I'm excited to present the 3rd CodeBots challenge. This one has been a long time in the making. This challenge will be split up in 3 sections: the short version, the long version, and additional details.
The Short Version
Each competitor will write a 24-command program. These bots will move around the ... |
I previously asked a question for how to compute a probability quickly and accurately. However, evidently it was too easy as a closed form solution was given! Here is a more difficult version.
This task is about writing code to compute a probability exactly and quickly. The output should be a precise probability writ... |
Fed up with experimenting on tiny domestic animals, Nobel prize-winning Erwin Schrödinger has decided to find the nearest laser and shoot it at things instead. Because... science!
Description
You will be given two points that the laser passes through and the size of a laser beam, and you must determine where the laser ... |
Compute 30000 digits of the mathematical constant π, with the fastest code.
Implement in any computer programming language that I can run in my 64 bit Linux machine. You should provide your compiler optimization options if any. I am ready to install a new compiler or language runtime to run your code, given that I am n... |
Ok, my first golf question. Please be gentle :) I know there's way too many ascii puzzles :P but here we go.
The task is simple, use your favorite programming language to print a triangle ripple. The input should be the size of the ripple.
Each triangle is evenly spaced out. Basically, you keep adding the triangles unt... |
A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with.
Given
A processor that implements only two instructions:
STO <register>, <address> (store from this register to this... |
A little genetics lesson
When you only have access to someone's visible traits or phenotype, a pedigree of their family history is often used to figure out the actual genetic information or, genotype of each family member.
When dealing with simple dominance as we will be, a simple pedigree chart will be enough to figu... |
It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error output with the smallest change to the source code (1 character addition).
Because other languages are more sane, this will b... |
The word BANANA appears exactly once in this word search:
B A N A A N B B
A B A N A B A N
A N A B N N A A
N N B A A A N N
N A A N N N B A
A N N N B A N A
N A A B A N A N
B A N A N B B A
The word search above contains only one occurrence of the word BANANA looking up, down, left, right, or diagonally, but it has lot of... |
This is a King of the Hill challenge in a round robin. It's a battle to find the best gunman of the west!
To be able to compete in this contest you need to make two functions. The first one sets the attributes of your gunman and the second is the main logic function for the gunman.
Attribute Function
function () {
... |
Your program must take an alpha/numeric input string and print it sideways (rotated 90 degrees clockwise). So for example, HI, would become:
#####
#
#####
#####
Rules:
The shortest code wins. For the sake of objectivity this will be the standard font. The input still only has to be alpha-numeric. Capitalization doe... |
Consider an array of integers:
[1, 0, 9, 1, 3, 8]
There are a lot of ways to partition this list into consecutive sublists. Here are three:
A: [[1, 0, 9], [1, 3, 8]]
B: [[1], [0, 9], [1, 3], [8]]
C: [[1, 0], [9, 1], [3, 8]]
We will call a partition Y and refinement of another partition X if X can be obtained from Y b... |
So,
My friend has come up with this interestng question, that is, given two numbers x and y deciding whether their difference: x-yis 0 or less without using any conditionals. The code should return 0 if they are 0 or less, or the result of the subtraction otherwise.
My attempt (In Pseudo-Java):
try {
Math.log(x-y);
} c... |
Background
A Pythagorean triangle is a right triangle where each side length is an integer (that is, the side lengths form a Pythagorean triple):
Using the sides of this triangle, we can attach two more non-congruent Pythagorean triangles as follows:
We can continue with this pattern as we see fit, so long as no two ... |
Pazaak is a card game from the Star Wars universe. It is similar to BlackJack, with two players pitted against each other trying to reach a total of twenty without going over. Each player has a "side deck" of four cards of their own that they can use to modify their score.
Leaderboard
As of 6/17/2015 @ 16:40 EDT
Edit: ... |
Background
Yes, bitstring physics is a real thing.
The idea is to construct a new theory of physics using only strings of bits that evolve under a probabilistic rule... or something.
Despite reading a couple of papers about it, I'm still pretty confused.
However, the bitstring universe makes for a nice little code golf... |
Tupper's Self-Referential Formula (copied from Wikipedia)
Tupper's self-referential formula is a formula defined by Jeff Tupper that, when graphed in two dimensions at a very specific location in the plane, can be "programmed" to visually reproduce the formula itself. It is used in various math and computer science cou... |
This challenge is NinjaBearMonkey's prize for winning my Block Building Bot Flocks! challenge with the Black Knight submission. Congratulations NinjaBearMonkey!
The challenge here is fairly simple, but has a variety of possible approaches. The story goes that in the world of Isometric Illusions, there are 6 different t... |
The process of Reversal-Addition is where a number is added to it's reverse until the number created is a palindrome. For example, if we start with 68, the process would be:
$$68 + 86 \to 154 + 451 \to 605 + 506 \to 1111$$
As you can see, this took 3 additions to get to a palindromic number. If we were to start with \$... |
Semiperfect numbers
A semiperfect/pseudoperfect number is an integer equal to the sum of a part of or all of its divisors (excluding itself). Numbers which are equal to the sum of all of their divisors are perfect.
Divisors of 6 : 1,2,3
6 = 1+2+3 -> semiperfect (perfect)
Divisors of 28 : 1,2,4,7,14
28 = 14+... |
A linear Diophantine equation in two variables is an equation of the form ax + by = c, where a, b and c are constant integers and x and y are integer variables.
For many naturally occurring Diophantine equations, x and y represent quantities that cannot be negative.
Task
Write a program or function that accepts the coe... |
In schools across the world, children type a number into their LCD calculator, turn it upside down and erupt into laughter after creating the word 'Boobies'. Of course, this is the most popular word, but there are many other words which can be produced.
All words must be less than 10 letters long, however (the diction... |
In typography, a counter is the area of a letter that is entirely or partially enclosed by a letter form or a symbol. A closed counter is a counter that is entirely enclosed by a letter form or symbol. You must write a program takes a string as input and prints the total number of closed counters in the text.
Your inp... |
Article Spinning with Spintax
Article spinning is a search engine optimization technique by which search engine optimizers post a unique version of relevant content on article directories, web 2.0 sites, or other sources for backlinks.
It is occasionally used by website authors on their own sites but usually avoided b... |
Challenge and origin
On Stack Overflow a popular question is: How to convert byte size into human readable format in java? The most up voted answer has a quite nice method for doing this, but this is codegolf and we can do better, can't we?
Your challenge is to write a method or program that coverts the given
number... |
You're given a tree, which in computer science tradition, has the root at the top and leaves at the bottom. The leaf nodes are labelled with numbers. Your goal is to take the special leaf marked -1 and move it up to be the new root.
[3, [[16], -1], [4]] --> [[[[4], 3], [16]]]
You can imagine rotating the special lea... |
This question is an extension of Check if words are isomorphs and copies the first part of it to give the definition of an isomorph.
Two words are isomorphs if they have the same pattern of letter repetitions. For example, both ESTATE and DUELED have pattern abcdca
ESTATE
DUELED
abcdca
because letters 1 and 6 are th... |
A Chinese checkerboard looks like this (based on this question, but this time it has a fixed size):
G
. G
G G G
G G . G
B B B B . . Y G . Y . Y Y
B B B . . G . . . Y Y Y
B . B . . . . . Y . Y
B . . . . . . . . Y
. . . . . . . . .
. P . . . . . O O .
P P . . . . .... |
Longest day of the year - here's something to waste the extra time...
Overview
Note this is not a popularity contest and not a graphical output challenge - you are only required to output a string of 65,536 zeroes and ones. The Stack Snippet at the bottom of the question will display this as a 256 by 256 black and whi... |
Background:
MtDNA is a part of the human DNA that is passed from a mother to a child and it rarely mutates. Since this is true for all humans it is possible to create a huge tree that visualize how all humans are related to each other through their maternal ancestry all the way back to the hypothetical EVE. Every mutat... |
A covering array is an N by k array in which each element is one of {0, 1, ..., v-1} (so v symbols in total), and for any t columns chosen (so an N x t array) contains all possible v^t tuples at least once. The applications of Covering Arrays range from software and hardware testing, interaction testing, and many other... |
Write a program or function that duplicates letters in a word, so that all the duplicated letters arranged from left to right in the word would form the input array.
For example:
input: chameleon, [c,a,l,n]
output: cchaamelleonn
Input
The starting word (e.g. chameleon)
An array of characters ([c,a,l,n]) or a string t... |
Rocket Bots
The year is 3024. People have become too scarce a resource to risk in war, so combat has shifted to the robots. Your task is to construct a bot like no other, who's rockets will rain destruction down on your foes and shoot down all incoming threats.
Gameplay
Bots
Gameplay takes place on a 10x15 grid. Your b... |
Inspired by this link I found on Reddit.
A FuzzyFinder is a feature of many text editors. As you start to type a file path S, the FuzzyFinder kicks in and shows you all files in the current directory containing the string you entered, sorted by the position of S in the file.
Your task is to implement a fuzzy finder. It... |
It looks like a fun language, but the official site is down and the EsoLangs page doesn't explain it quite well and looks like it's missing stuff. Is there anywhere that the language is documented?
|
What general tips do you have for golfing in TI-BASIC for the TI-83/84+ series calculators? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to TI-BASIC (e.g. "remove comments" is not an answer).
Please post one tip per answer.
|
Atomic chess is a (very fun)
variant of chess in which every capture causes an "explosion," destroying the
captured piece, the piece doing the capturing, and all non-pawns in a 1-square
radius. The goal of this challenge is not to play an entire game of atomic
chess, but simply to simulate what happens when a certain m... |
Background
The Random Domino Automaton is a toy model for earthquakes, inspired by cellular automata.
In this challenge, your task is to simulate a simplified version of this model, and collect data out of it.
The automaton is defined on an array A of k bits, representing a fault line on which earthquakes may occur.
Th... |
Anybody can make the output of a program bigger by adding characters, so let's do the exact opposite.
Write a full program, an inner function or a snippet for a REPL environment in a language of your choice that satisfies the following criteria:
Your code must be at least 1 character long.
Running the original code pr... |
If you take a sheet of graph paper and draw a sloped line that goes m units right and n units up, you cross n-1 horizontal and m-1 vertical gridlines in some sequence. Write code to output that sequence.
For example, m=5 and n=3 gives:
Possibly related: Generating Euclidian rhythms, Fibonacci tilings, FizzBuzz
Input: ... |
Write a program or named function that will output or return the sequence up to the nth integer in the Iccanobif sequence, documented on OEIS as A014258. Note that only the zeroth element in the sequence (0) will be printed if n is zero.
The sequence is generated by starting like the standard Fibonacci sequence, but af... |
The Task
In this challenge, your task is to draw an ASCII art representation of several stacks of boxes of increasing height.
You are given as input the number of stacks, which is a positive integer.
The first stack contains one box of size 2x2.
The second stack contains 2 boxes of size 3x3.
In general, the kth stack c... |
When manufacturing chips, circular silicon wafers are cut into dies of needed size:
The goal of this challenge is maximizing the number of whole dies that can be cut from a wafer of a given diameter.
The machine puts the wafer into an angular compartment:
_____________________
| xxxxxx
| xxxxxxxxxxxx
| xxxxxxxxxx... |
Tasks
All competitors try to solve the following list of 10 tasks:
math
Read a positive integer n from input and return the sum of the cubes of the first n non-negative integers.
For input 1, this should return 0.
Read a positive integer n from input and return a truthy value if and only if n is a Mersenne prime.
Read... |
Square numbers are those that take the form of \$n^2\$ where \$n\$ is an integer. These are also called perfect squares, because when you take their square root you get an integer.
The first 10 square numbers are: (OEIS)
0, 1, 4, 9, 16, 25, 36, 49, 64, 81
Triangular numbers are numbers that can form an equilateral tri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.