text:
The Complement Cat
Objective Write a full program that outputs (to STDOUT or closest alternative) an arbitrary string of text, no more than 64 characters long. Simple enough, right? Well, here's the catch: You may not use any characters that were present in the previous answer's output. That's right, none of them.
Thus, you are trying to be the last answer for a total of three days. That is, you want no one to answer the question in the 72 hours following the posting of your question.
Some rules

Your answer (and output) may only contain printable ASCII characters, newlines (carriage returns included), and tabs.
Your answer's output may not be the same as another answer's output. Two output's are the same if and only if they use the exact same characters.
You may use any language that was not specifically made for this challenge, even if it was made after the challenge. (This language, of course, must be testable.)
You may not use any language that was previously used.
Your entry may not include comments. You may, of course, provide an extra commented program.
You may not answer twice in a row.
Your program must be at least 1 byte.

Entry format
Your answer should look generally like the following:
# {Language}
Uses: `characters present in the output`

Does not use: `characters used in the previous output` from [previous submission, language](link-to-previous-submission]

    {program}

Outputs:

    {output}

An explanation with your answer is appreciated.

@CᴏɴᴏʀO'Bʀɪᴇɴ And empty outputs?

@jimmy23013 It isn't advised, but yeah, they're allowed.

As exiting with an error is usually allowed, this makes it impossible to win unless we run out of interpreted languages.

I'm wildly confused about what is being asked. I have to print any <=64 char string, and I can't use the characters in the latest submission's output?

(Also, a leaderboard that keeps track of used languages alphabetically would be cool.)

@Mauris Yes, that is correct.

Ah, okay; the bit about "character space" is really confusing IMO. That term doesn't mean anything... Maybe you should rewrite it?

@Mauris I define it.

@CᴏɴᴏʀO'Bʀɪᴇɴ, character space == "The exact same characters as the last submission, in any order"?

@StewieGriffin The exact same characters as any previous submission in any order.

"You may not use any characters that were present in the previous answer's output." Do you mean you can't use them in the source code, or they can't appear in the output? You tagged this [tag:restricted-source], so I'm guessing the former...

The former @ThisSuitIsBlackNot

Could you add a snippet to generate a list of the languages that have been used?

@SuperJedi224 Yeah, working on it

This is really confusing - aside from the issue of "character space" mentioned above, why would this challenge, as stated, make you want to be the last person to answer (for any period of time)?

@question_asker If nobody can come up with an answer to follow yours, you win the challenge (and get the green checkmark). For example, if I wrote a program that outputs every printable ASCII character, it would be impossible to follow (ignoring those annoying languages that generate output for the empty program).

@ThisSuitIsBlackNot yeah, the idea of "winning" occurred to me after it was too late to make an edit. That said, I'm still confused as to whether it's the code, output, or both that is not to be duplicated, and whether it's all previous entries or just the previous entry.

@question_asker Your code cannot contain any of the characters from the previous answer's output; your output cannot use the same set of characters as any previous output. If the code for the first answer is foo and it outputs bar, the code for the next answer cannot contain b, a, or r; no subsequent answer can output abr, arb, bar, bra, rab, or rba. (Yes, I agree this was very confusing.)

I think it's been 72 hours since my entry.

@Mauris and so it has! Congratulations!

Ruby
$><<'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" '

Does not use abcdefghijklmnopqrstuvwxyz{}\~_^[]|` from the previous answer.
Prints, and hence uses, ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", a space, and a newline.

Brainfuck
Uses: -.
Does not use: !"%&')+,0123456789<=>ABCDEFGHIJKLNOPRSTWXYZ]`acefghjlnoprstux{| from CJam.
Thanks to SuperJedi
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.---------------------------.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.-------------------------------------------------------------------------------------------.-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.

Outputs:
; (){}[]"'

This could be altered to only use - and .. That's my proposal for the purposes of the challenge.

http://tinyurl.com/obzsvot

Sorry, I took the uses portion to mean that those were the entities used in the code. Gimme a goddamn minute before you start using downvotes.

Pyth
Uses: ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg.
Doesn't use: !"#$%&'()*+,-./0123456789:;<=>?@[\]^_`abcdefghijklnsm{|}~ from previous submission in Octave.
Code:
pMCMryyTyyytytttT

Output:
()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg

Is there a space in there? I guess there aren't any tabs or newlines that aren't shown? It looks like the next answer must be a whitespace answer (or at least close)...

No whitespace in the output that's mine; I don't know if the language appends a newline though

CJam
Uses: 0123456789:;_bc
Does not use:  !GSaefgimnoprstuw, from previous submission, MATLAB
183185535513294435547695067785526290427932963043839368372854060721693597139131275368051870173845056551161192991350318233082749156998652_;128b:c

Outputs:
 !"%&')+,0123456789<=>ABCDEFGHIJKLNOPRSTWXYZ]`acefghjlnoprstux{|

Well, I can't beat this.

Octave
Uses:  !"#$%&'()*+,-./0123456789:;<=>?@[\]^_``abcdefghijklnsm{|}~ and a newline in the output.
Doesn't use: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" from previous submission in Microscript.
Code:
[' ':'@','[':'`','{':'~',('@'+' '):('>'+'/')]

Output:
ans =
 !"#$%&'()*+,-./0123456789:;<=>?@[\]^_`{|}~`abcdefghijklm

Explanation:
This is a collection of consecutive ASCII-characters. The code is equivalent to:
[char(32:64) char(91:96) char(123:126) char(96:109)]

Where char(32:64) are the ASCII characters from 32 to 64 (space to @). In order to get the alphabet-part in the end of the output, I had to add characters, as I couldn't use a and m. @+  equals 96 (``) and >+/ equals 109 (m)

How does this work?

@CᴏɴᴏʀO'Bʀɪᴇɴ, explanation included =)

Perl
Uses:  0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz} (with space)
Does not use: "#$%'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|~ from previous submission in Unreadable
eval q!print uc q&} abcdefghijklmnopqrstuvwxyz&!and eval q}print q&0abcdefghijklmnopqrstuvwxyz&}and eval q&print length for qw!a bc def ghij klmno pqrstu vwxyzab cdefghij klmnopqrs!&

Outputs:
} ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz123456789

…the old joke about monkeys writing code comes to mind…
You can run the program online.
This program abuses the weird features of Perl to write code in just about any subset of ASCII:

Functions can be called without parentheses in some cases (unsure about exact rules)
q#text# where # can be almost any character is the same as "text"
qw#word1 word2 word3# like the above is the same as ["word1", "word2", "word3"]
for loops and other things can be appended to lines, eliminating any punctuation

Javascript ES6
Previous answer: https://codegolf.stackexchange.com/a/67406/39022
Source does not contain !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ, space, or newline.
alert`abcdefghijklmnopqrstuvwxyz{}\\~_^[]|\``

Output:
abcdefghijklmnopqrstuvwxyz{}\~_^[]|`

(Lowercase alphabet, curly brackets, backslash, tilde, underscore, carat, square brackets, pipe, and backtick)

I believe you mean backslash instead of forward slash. But nice entry!

@ETHproductions You're right about the backslash.

Python 3
Uses: !CGaceilmnoprstw z.
print("Germanic Capitalization is awesome!")

Simply prints Germanic Capitalization is awesome! with no restrictions. Good luck!

MATLAB
Uses:  !GSaefgimnoprstuw and newline.
Does not use: !CGaceilmnoprstw z from previous submission, Python 3.
[83,116,101,119,105,101,32,71,114,105,102,102,105,110,32,105,115,32,97,32,112,114,111,109,105,110,101,110,116,32,103,101,110,105,111,117,115,33,'']

Prints:
ans =

Stewie Griffin is a prominent genious!

Microscript II
Previous answer: here. Program does not use semicolon, space, parentheses, curly brackets, square brackets, single straight quotes, or double straight quotes. This program would be a lot shorter if it didn't have to avoid quotes.
Output includes: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", and a newline.
Program:
97Kp98Kp99Kp100Kp101Kp102Kp103Kp104Kp105Kp106Kp107Kp108Kp109Kp110Kp111Kp112Kp113Kp114Kp115Kp116Kp117Kp118Kp119Kp120Kp121Kp122Kp""P65Kp66Kp67Kp68Kp69Kp70Kp71Kp72Kp73Kp74Kp75Kp76Kp77Kp78Kp79Kp80Kp81Kp82Kp83Kp84Kp85Kp86Kp87Kp88Kp89Kp90Kp123456789qh

Exact output:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ"123456789"

And the Does not incude bit.

Unreadable
Uses: "#$%'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|~
Does not use: ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg from previous submission in Pyth

'"'""'""'"'""'"'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'"'""'""'"'""'"'""'"'""'"'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""

Outputs:
"#$%'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|~

In case you are wondering, yes, programming by hand in this language is painful, so I made this script (in JavaScript) to generate the code:
var program = `"`,
    output = "\"#$%'()*+,-./123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|~";
for(var i = 1, c = 0; c < output.length; i++) {
  program = `'""` + program;
  if(i == output.charCodeAt(c)) {
    program = `'"` + program;
    c++;
  }
}
program;

I used the Python interpreter for Unreadable here to run the code.

Having a space in there would make life hard for the next one =)

@StewieGriffin That's true. Is it too late to edit? xD TBH though, I think this challenge can go on for a lot longer because there's many languages which have pre-set variables in either upper or lower-case letters, so just the one character would be a valid answer. (Even though it wouldn't be too interesting and makes it very easy for the next answer!)

I think it's too late now. Someone might be working on a solution in for instance whitespace, and suddenly adding a space in the output will probably make them annoyed.

@StewieGriffin Yeah, that was my reasoning too.

GolfScript
Uses: space, newline, !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ.
Doesn't use 0-9A-Za-z{ or space from previous submission in Perl.
The code:
'!'.!=('['.!=,>''+

The output:
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

And a trailing newline.
Try it here.


text:
Convolve integers in subquadratic time
An linear discrete convolution is an operation that turns two vectors of numbers into a third vector of numbers by multiplying elements inside-out. Formally, for two vectors a and b with elements 0 to n - 1, the discrete linear convolution of a and b can be computed with this loop:
for i = 0 to 2*n - 2
    c[i] = 0;
    for j = 0 to n - 1
        if i - j >= 0 and i - j < n
            c[i] = c[i] + a[j] * b[i - j];

As an example, the convolution of a = { 1, 2, 3, 4 } and b = { 5, 6, 7, 8 } is c = { 5, 16, 34, 60, 61, 52, 32 }.
These convolutions appear when doing long multiplication, for example:
1234 * 5678 =
         20 24 28 32
      15 18 21 24
   10 12 14 16
 5  6  7  8
--------------------
 5 16 34 60 61 52 32
--------------------
      32
     52
    61
   60
  34
 16
 5
--------------------
 7006652

Your task is to write a program or function that, given two arrays (or similar) a and b of non-negative integers of equal length n and optionally, n and an output array c, computes the linear discrete convolution of a and b and returns it, assigns it to the parameter c. or prints it out. You may also take input from the user while or before your code is running. The following constraints apply:

Your program must run in subquadratic or o(n 2) time. An algorithm like the pseudo-code above that runs in quadratic time Θ(n 2) is invalid.
You may assume that all integers in in- and output are in the range from 0 to 65535, this also applies to n.
You may not claim that your algorithm runs in subquadratic time because n has an upper bound.
The results must be exact.
This is code golf, the shortest code in octets wins.
You may not use existing library routines or similar to compute a Fourier transform or a number theoretic transform or the respective inverse transformations.

@LegionMammal978 No, O(n²) time allows for quadratic-time algorithms. o(n²) doesn't, that's the difference between big-O and little-O (think of big-O being ≤ and little-o being <).

@LegionMammal978 No, that's Ω vs. Θ vs. O. There is also ω and o.

@LegionMammal978 Why do you delete your comments? They are useful for future readers.

Comments are not for discussions. For the record, I was confused about the differences between big- and little-O complexity.

@LegionMammal978 Maybe other users are confused, too. Your comments help them and answer questions they might have asked again.

@PeterTaylor Reworded.

@FUZxxl If you think other users might stumble over the same confusion, then it's something you should address in the challenge. Comments aren't meant to be permanent, and people shouldn't be expected to read them.

So, let me get this straight: looping through each digit in each of the two integers qualifies for Θ(n²), but not o(n²), which makes it invalid?

@ETHproductions yes.

@FUZxxl I think you should say "discrete convolution", not "linear discrete convolution". A convolution is always a linear operation, AFAIK

@LuisMendo There are also cyclic and negacyclic convolutions, so I felt the need to clarify that the convolution isn't cyclic. Perhaps I should have said “acyclic?”

@FUZxxl Oh, you mean "linear" as opposed to "circular". I always call that just "convolution". But you're right, now I see in which sense you said linear

I'll give a 200-point bounty for any TI-BASIC solution, with no time limit.

"You may not use existing library routines or similar to compute a Fourier transform or a number theoretic transform or the respective inverse transformations." but direct builtin is not banned XD

@l4m2 No, built-in FFT is not allowed either.

I mean builtin convolve

J, 79 bytes, O(n log n)
f=:_2&(0((+,-)]%_1^i.@#%#)&f/@|:]\)~1<#
<:@+&#$9(o.f%#)[:+@*/;f@{.&>~2^#@#:@+&#

Uses the Convolution theorem which states that the Fourier transform of the convolution of two sequences is equal to the Fourier transform of each sequence multiplied together elementwise.
Fourier( Convolve(a, b) ) = Fourier(a) * Fourier(b)
Convolve(a, b) = InverseFourier( Fourier(a) * Fourier(b) )

Also uses the fact the the inverse Fourier transform can be applied by using the Fourier transform of the conjugate.
InverseFourier(a) = Conjugate( Fourier( Conjugate(a) ) ) / Length(a)

I used the FFT implementation from a previous solution. That implementation uses the Cooley-Tukey algorithm for sequences where the length is a power of 2. Therefore, I have to zero-pad the input sequences to the a power of 2 (typically the minimal value that is valid) such that their lengths are greater than or equal to the sum of the lengths of the input sequences.
Usage
   f =: _2&(0((+,-)]%_1^i.@#%#)&f/@|:]\)~1<#
   g =: <:@+&#$9(o.f%#)[:+@*/;f@{.&>~2^#@#:@+&#
   1 2 3 4 g 5 6 7 8
5 16 34 60 61 52 32
   2 4 5 6 1 g 1 2 4 7
2 8 21 46 61 61 46 7

Try it online!
Explanation
An explanation for the FFT portion in J is included in my previous solution to a different challenge.
<:@+&#$9(o.f%#)[:+@*/;f@{.&>~2^#@#:@+&#  Input: A on LHS, B on RHS
                                      #  Get the lengths of A and B
                                    +&   Sum them
                                 #:@     Get list of binary digits
                               #@        Length
                             2^           Raise 2 to that power, call it N
                     ;                    Link A and B as a pair of boxed arrays
                          &>~             For each box
                        {.                  Take N values, extending with zeros
                      f@                    Apply FFT to it
               [:  */                    Reduce using multiplication
                 +@                      Conjugate
           f                             Apply FFT
            %                            Divide by
             #                           Length
       9 o.                              Take the real part
     #                                   Get the lengths of A and B
   +&                                    Sum them
<:@                                      Decrement
      $                                  Shape to that length and return

Maybe you can avoid having a name for f using &. or such? Not sure though.

@FUZxxl It'd be amazing if J could figure out the Fourier inverse from that. It might be possible by reorganizing the tacit FFT but it'd probably cost more than just using conjugate and such. But this is barely golfed, other than the FFT part. Using f&.+ doesn't work since + is rank 0 which means that f gets applied to each value individually. But there's probably a way.

@FUZxxl I've got (9 o.[:(f&.(+"1)%#)*&f) as a possible version but it ends up being 1 byte longer.

f&.:+ would probably.

@FUZxxl I just had a couple ideas from that, and didn't even know the : (whole) extended past @ but also to & and &.. Well, I probably read it and long forgotten.

Python 2, 250 bytes, n^log_2(3)
s=lambda a,b,S=1:[x+y*S for x,y in zip(a,b)]
def f(a,A):
 n=len(a);m=n/2
 if m<1:return[a[0]*A[0]]
 if n%2:return f([0]+a,[0]+A)[2:]
 b,c=a[:m],a[m:];B,C=A[:m],A[m:];p=f(b,B);r=f(c,C);z=m*[0];return s(z+z+r,s(z+s(f(s(b,c),s(B,C)),s(p,r),-1)+z,p+z+z))

This isn't well golfed, but more a proof of concept of the algorithm. Let's look at a more readable version.
s=lambda a,b,S=1:[x+y*S for x,y in zip(a,b)]

def f(a,A):
 n=len(a)
 if n==1:return[a[0]*A[0]]
 if n%2:return f([0]+a,[0]+A)[2:]
 m=n/2
 b,c=a[:m],a[m:]
 B,C=A[:m],A[m:]
 p=f(b,B)
 r=f(c,C)
 q=s(f(s(b,c),s(B,C)),s(p,r),-1)
 z=m*[0]
 return s(z+z+r,s(z+q+z,p+z+z))

The idea is to divide and conquer adapting the Karatsuba multiplication algorithm to do convolution. As before, it runs in time n^log_2(3), as it makes 3 recursive calls which shrink the input length in half. This isn't as good as the quasilinear of DFT, but still better than quadratic.
We can think of convolution as multiplication of formal polynomials. Alternatively, if multiplication were done without regrouping, you'd get convolution. So, adapting the algorithm only requires doing vector addition and subtraction instead of the numerical operations. These additions are still linear-time.
Unfortunately for Python, it doesn't have built-in vector addition and subtraction, so we hack together a function s to do both: addition by default, and subtraction when passed an optional argument of -1. Whenever we add, we make sure to pad with zeroes to avoid truncation.
We handle odd list lengths by padding with a zero to an even length, removing the extraneous zeroes that result.

Mathematica, 214 bytes, O(n log n)
f@{a_}:={a}
f@a_:=#~Join~#+Join[#2,#2]Exp[2.Most@Range[0,1,1/Length@a]Pi I]&@@f/@Thread@Partition[a,2]
(l=Length@#;RotateLeft[Round[#/Length@#]][[-1;;(1-2l);;-1]]&@f[Times@@(f@PadRight[#,2^Floor[2+Log2@l]]&/@{##})])&

Function f performs FFT, which is called several times. No built-in FFT is used here.
%[{1,2,3,4},{5,6,7,8}]
(* {5,16,34,60,61,52,32} *)

You are not allowed to use builtin FFT functionality.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Pentagonal numbers made from pentagonal numbers
Introduction
A pentagonal number (A000326) is generated by the formula Pn= 0.5×(3n2-n). Or you can just count the amount of dots used:

You can use the formula, or the gif above to find the first few pentagonal numbers:
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, 176, 210, 247, 287, 330, 376, 425, 477, etc...

Next, we need to compute the sum of x consecutive numbers.
For example, if x = 4, we need to look at Pn + Pn+1 + Pn+2 + Pn+3 (which consists of 4 terms). If the sum of the pentagonal numbers also is a pentagonal number, we will call this a pentagonal pentagon number.
For x = 4, the smallest pentagonal pentagon number is 330, which is made of 4 consecutive pentagonal numbers: 51, 70, 92, 117. So, when the input is 4, your program of function should output 330.

Task

When given an integer greater than 1, output the smallest pentagonal pentagon number.
You may provide a function or a program.
Note: There are no solutions for e.g. x = 3. This means that if a number cannot be made from the first 10000 pentagonal numbers, you must stop computing and output whatever fits best for you.
This is code-golf, so the submission with the least amount of bytes wins!

Test cases:
Input: 2
Output: 1926 (which comes from 925, 1001)

Input: 3
Output: ?

Input: 4
Output: 330 (which comes from 51, 70, 92, 117)

Input: 5
Output: 44290 (which comes from 8400, 8626, 8855, 9087, 9322)

Input: 6
Output: 651 (which comes from 51, 70, 92, 117, 145, 176)

Input: 7
Output: 287 (which comes from 5, 12, 22, 35, 51, 70, 92)

Input: 8
Output: ?

Input: 9
Output: 12105 (which comes from 1001, 1080, 1162, 1247, 1335, 1426, 1520, 1617, 1717)

Input: 10
Output: ?

Also bigger numbers can be given:
Input: 37
Output: 32782

Input: 55
Output: 71349465

Input: 71
Output: 24565290

IMO it's crazy to penalise anyone who comes up with an analytic solution which can solve the harder cases by requiring them to check whether the solution is less than 10001-x

@PeterTaylor With harder cases you mean like x = 3, which has no solutions?

The largest test case that yields a result: 9919 --> 496458299155

No, I mean cases which have solutions but which use larger pentagonal numbers in the sum.

I'm not sure about the 10,000 limit: Do the numbers that build the sum have to come from the first 10,000 pentagonal numbers, but not the sum itself, or has the sum also to be within the first 10,000?

@nimi Only the numbers that build the sum have to come from the first 10000 pentagonal numbers. The sum itself may exceed this amount.

@PeterTaylor That means you need to prove that the x value has a solution in the first place. Or else it would run infinitely on non-solution integers.

So what's the big deal?

CJam, 29 bytes
6e5{)_3*(*2/}%_A4#<riew::+&1<

Try it online.
Takes a couple of seconds to run.
Explanation
First, we need to check how many pentagonal numbers we need to consider as potential sums. The sum of the first 10,000 pentagonal numbers is 500050000000. The first pentagonal number greater than that is the 577,380th.
6e5       e# 600,000 (a short number that's a bit bigger than we need).
{         e# Map this block onto every number from 0 to 599,999...
  )       e#   Increment.
  _3*(*2/ e#   Apply the pentagonal number formula given in the challenge.
}%
_         e# Make a copy.
A4#<      e# Truncate to the first 10,000 elements.
ri        e# Read input and convert to integer.
ew        e# Get sublists of that length.
::+       e# Sum each sublist.
&         e# Set intersection with all 600k pentagonal numbers computed earlier.
1<        e# Truncate to the first result.

I used a slightly modified program to find the largest inputs which yield a non-empty solution. These are all the solutions for inputs greater than 9,000:
9919 -> 496458299155
9577 -> 446991927537
9499 -> 455533474060
9241 -> 401702906276
9017 -> 429351677617

Lua, 142 Bytes
p={}o={}n=...for i=1,10^4 do p[i]=(3*i^2-i)/2o[p[i]]=1 end for i=0,10^4-n do s=0 for j=1,n do s=s+p[i+j]end if(o[s])then print(s)break end end

Ungolfed
p={}o={}n=tonumber(...)
for i=1,10^4 do
    p[i]=(3*i^2-i)/2o[p[i]]=1
end
for i=0,10^4-n do
    s=0
    for j=1,n do
        s=s+p[i+j]
    end
    if(o[s])then
        print(s)
        break
    end
end

Yay for inverting tables!
Update 142 Bytes: Saved 10 bytes by removing superfluous 'tonumber' function call.

Haskell, 109 bytes
p=map(\n->div(3*n^2-n)2)[1..10^7]
(%)=(sum.).take
x#l|length l<x=0|elem(x%l)p=x%l|1<2=x#tail l
(#take(10^4)p)

Returns 0 if there's no pentagonal pentagon number.
Usage example (takes some time to finish): map (#take(10^4)p) [1..10] -> [1,1926,0,330,44290,651,287,0,12105,0].
It's more or less a direct implementation of the definition: if the sum of the first x elements is in the list, output it, else re-try with the tail of the list. Start with the first 10,000 pentagonal numbers, stop and return 0 if the list has less than x elements.

PARI/GP, 71 bytes
I like the ispolygonal function in PARI/GP.
x->[p|p<-vector(10^4,i,sum(n=i,i+x-1,(3*n^2-n)/2)),ispolygonal(p,5)][1]

Python 3, 144 bytes
R,P=range,list(map(lambda n:(3*n*n-n)/2,R(1,10001)))
def F(X):
 for a in R(0,len(P)-X):
    S=sum(P[a:a+X])
    if(1+(1+24*S)**.5)%6==0:print(S);break

This reverses the definition of a pentagonal number; if P(n) = (3n^2-n)/2, then a given P will be a pentagonal number iff (1+sqrt(24*P+1))/6 is an integer.  (Technically, it should also look at (1-sqrt(24*P+1))/6, but that should always be negative.)  Also uses spaces and tabs as two different indentation levels, as suggested here.  This doesn't output anything if it can't find a pentagonal pentagonal number; I trust that's OK?
I strongly believe that someone more clever than I am could find a way to shorten this even more, probably around the for loop.

R, 114 100 bytes
k=.5*(3*(t=1:1e6)^2-t);z=1;for(i in 1:(1e4-(n=scan()-1)))z[i]=sum(k[i:(i+n)]);cat(intersect(k,z)[1])

ungolfed (kinda)
k=.5*(3*(t=1:1e6)^2-t)                 # map all pentagon numbers up to 1e6
z=1                                    # create a vector
for(i in 1:(1e4-(n=scan()-1))){        # from 1 to 10.000 - n loop
  z[i]=sum(k[i:(i+n)])}                # get the sum of all pentagon numbers i:(i+n)
cat(intersect(k,z)[1])                 # see which sums is a pentagon number itself, plot the first

Mathematica 85 bytes
n=577380;Intersection[#(3#-1)/2&/@Range@n,Table[#((#-1)^2+x(3#-4+3x))/2,{x,n}]][[1]]&

perfoms a quick search up to  P104.

LabVIEW, 39 LabVIEW Primitives
No gif of it running this time.
Math node in loop creates an array of all the numbers. Take Sub-array, add elements, search for that number, if found take index and stop loop.
An invalid input puts out the highest pentagonal number.

Jelly, 30 bytes
×24‘½‘%6¬Oị
15ȷ7RÇṫ³R$zȷ.5ZSÇḢ

This code works with this version of Jelly and is equivalent to the following binary code:
0000000: 94 32 34 b2 90 b2 25 36 87 4f b1 0a 31 35 a0  .24...%6.O..15.
000000f: 37 52 92 ad 8b 52 24 7a a0 2e 35 5a 53 92 a6  7R...R$z..5ZS..

It is by far to slow and memory hungry for the online interpreter, since it checks the first 150,000,000 for pentagonality (149,995,000 happens to be the 10,000th pentagonal number).
By shortening the range to something more sensible, you can Try it online! for small enough inputs.
Idea
A known result about pentagonal numbers is that x is pentagonal if and only if sqrt(24x + 1) - 1 is divisible by 6.
Rather than computing the first 10,000 pentagonal numbers, we define a helper link that removes non-pentagonal numbers from a given array. Why? Because the latest version of Jelly that predates this challenge has no sane way to intersect lists...
Code
×24‘½‘%6¬Oị  Define the aforementioned helper link. Left argument: a (list)

×24          Multiply each list item by 24.
   ‘         Increment each product.
    ½        Apply square root to each result.
     ’       Decrement each square root.
      %6     Compute all remainders of division by 6.
        ¬    Apply logical NOT.
         O   Get the indices of ones.
          ị  Hook; get the elements of a at those indices.

15ȷ7RÇṫ³R$zȷ.5ZSÇḢ  Define the main link. Input: x

15ȷ7R               Yields [1, ..., 1.5e8].
     Ç              Apply the helper link; keep only pentagonal numbers.
       ³R$          Yield r = [1, ..., x].
      ṫ             Remove the first y-1 pentagonal numbers for each y in r.
          zȷ.5      Transpose the resulting array, padding with sqrt(10).
              Z     Transpose once more. The shifted lists have now been padded.
                    This makes sure incomplete sums (i.e., of less than x
                    pentagonal numbers) will not be integers.
               S    Compute all sums.
                Ç   Apply the helper link once more.
                 Ḣ  Select the first match, if any.

Jelly, 21 bytes (non-competing)
ȷ6Rµ²×3_¹Hµḣȷ4ṡ³ZSf¹Ḣ

The latest version of Jelly has two new features (overlapping slices and and list filtering / intersection) and a bug fix, which allows a much lower byte count.
This code works fine on my desktop computer, but it's a tad to slow for TIO's time limit. To Try it online! (for sufficiently small inputs), we have to reduce the initial range once again.
How it works
ȷ6Rµ²×3_¹Hµḣȷ4ṡ³ZSf¹Ḣ  Input: x

ȷ6R                    Yield [1, ..., 1,000,000].
   µ                   Begin a new, monadic chain.
    ²                  Square each number in the range.
     ×3                Multiply the squares by 3.
       _¹              Subtract the numbers from the range.
         H             Halve each difference.
                       This yields the first 1,000,000 pentagonal numbers.
          µ            Begin a new, monadic chain.
           ḣȷ4         Keep only the first 10,000 pentagonal numbers.
              ṡ³       Yield all overlapping slices of length x.
                ZS     Transpose and sum. This computes the sum of each slice.
                  f¹   Filter; intersect with the long list of pentagonal numbers.
                    Ḣ  Select the first match, if any.

Axiom, 157 bytes
p(n)==(3*n*n-n)quo 2;f(x)==(a:=0;for i in 1..x repeat a:=a+p(i);for j in 1..10000 repeat(p(floor((1+sqrt(1.+24*a))/6)::INT)=a=>return a;a:=a+p(j+x)-p(j));-1)

ungolfed and results
h(x:PI):INT==
   a:=0;for i in 1..x repeat a:=a+p(i) -- sum(p(i),i=1..x)
   for j in 1..10000 repeat
      p(floor((1+sqrt(1.+24*a))/6)::INT)=a=>return a
      a:=a+p(j+x)-p(j)
   -1

(5) -> [[i,f(i)] for i in 1..10]
   (5)
   [[1,1], [2,1926], [3,- 1], [4,330], [5,44290], [6,651], [7,287], [8,- 1],
    [9,12105], [10,- 1]]
                                                  Type: List List Integer

esplenation:
We can find n using the result "a", see below
a=(3*n^2-n)/2 => 3*n^2-n-2*a=0 => n=floor((1+sqrt(1.+24*a))/6)::INT

[use 1+sqrt(...) because n>0]
This above means that if exist one n0 such that
p(n0)=a

than
n0=floor((1+sqrt(1.+24*a))/6)::INT

Afher that we have to prove that p(n0)=a for to be sure (because it is not always so)
But the main trick would be doing the sum
a:=sum(p(i),i=1..x) [x elements sum]

only at the start, and find the next x elements sum simply using
a=a+p(x+1)-p(1)=sum(p(i), i=2..x+1)

and so on for the other sums (using above in the statement a:=a+p(j+x)-p(j) ).
This means it is not necessary one number x element sum inside the loop...
..

Javascript 93 bytes

p=i=>i>0&&3*i*i-i>>1
f=(x,i=1,t=0)=>i<1e4?(24*(t+=p(i)-p(i-x))+1)**.5%6==5&i>x?t:f(x,i+1,t):0

console.log(f(4))
console.log(f(5))
console.log(f(6))
console.log(f(7))
console.log(f(8))
console.log(f(9919)==496458299155)
console.log(f(9577)==446991927537)
console.log(f(9499)==455533474060)
console.log(f(9241)==401702906276)
console.log(f(9017)==429351677617)
console.log(f(9))
console.log(f(10))

Python 2, 128 124 bytes
X=input();N=S=0
while all(S-(3*n*n-n)/2for n in range(S)):N+=1;S=sum(3*(n+N)**2-n-N>>1for n in range(X));N<1e4or 0/0
print S

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Write an interpreter for 2B
Write an interpreter for 2B
I like David Catt's esoteric language 2B, having memory stored in a tape where each cell is a seperate tape of bytes (the 'subtape'). Write an interpreter for it!
Language Specification
Official specification can be found here. In this specification, " means a number in the range 0-9 (0 is interpreted as 10), and _ means a string of any length. Each cell stores a value in the range 0-255, and overflow/underflow wraps around as it would a BF. (Thanks @MartinBüttner). To convert text to numbers 0-255, use ASCII codes. Because I can find no detail on this, I'm going to say that the tape length should be 255 minimum, but if you know otherwise please edit.
+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
| Instruction |                                                              Description                                                               |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
| 0           | Zeroes the current cell and clears the overflow/underflow flag.                                                                        |
| {           | If the current cell is zero, jump to the matching }.                                                                                |
| }           | A placeholder for the { instruction.                                                                                |
| (           | Read a byte from the input stream and place it in the current cell.                                                                    |
| )           | Write the value of the current cell to the console.                                                                                |
| x           | Store the value of the current cell in a temporary register.                                                                           |
| o           | Write the value of the temporary register to the console.                                                                              |
| !           | If the last addition overflowed, add one to the current cell. If the last subtraction underflowed, subtract one from the current cell. |
| ?           | Performs a binary NOT on the current cell.                                                                                |
| +"          | Adds an amount to the current cell.                                                                                |
| -"          | Subtracts an amount from the current cell.                                                                                |
| ^"          | Moves the subtape up a number of times.                                                                                |
| V"          | Moves the subtape down a number of times.                                                                                |
| <"          | Moves the tape left a number of times.                                                                                |
| >"          | Moves the tape right a number of times.                                                                                |
| :_:         | Defines a label of name _.                                                                                |
| *_*         | Jumps to a label of name _.                                                                                |
| ~_~         | Defines a function of name _.                                                                                |
| @_@         | Calls a function of name _.                                                                                |
| %           | Ends a function definition.                                                                                |
| #_#         | Is a comment.                                                                                |
| [SPACE]     | Is an NOP.                                                                                |
| [NEWLINE]   | Is treated as whitespace and removed.                                                                                |
| [TAB]       | Is treated as whitespace and removed.                                                                                |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------+

Tests
+0+0+0+0+0+0+0+2)+0+0+9)+7))+3)-0-0-0-0-0-0-0-9)+0+0+0+0+0+0+0+0+7)-8)+3)-6)-8)-7-0-0-0-0-0-0)

Should output Hello world!

+1:i:{()*i*}
Sort of a cat program, just without a newline.

+1:loop:{@ReadChar@*loop*}@PrintHello@@WriteAll@(~ReadChar~(x-0-3<2o^1>1+1>1%~PrintHello~+0+0+0+0+0+0+0+2)-1+0+0+0)+7))+3)+1-0-0-0-0-0-0-0-0)%~WriteAll~<1x:reverse:{<1v1>1-1*reverse*}o-1:print:{-1<1)^1>1*print*}%
Should first accept a name, then, on press of Return, should output Hello name (where name is what was inputted).
Credit for that program goes to David Catt.

I'm working on a full test program.
Rules

Standard loopholes are forbidden
Your interpreter must meet all the specifications, except for comments, which are not required.

Scoring

This is code-golf, so fewest bytes wins!
-10 bytes if your interpreter handles comments.

Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

var QUESTION_ID=67123;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),e.has_more?getAnswers():process()}})}function shouldHaveHeading(e){var a=!1,r=e.body_markdown.split("\n");try{a|=/^#/.test(e.body_markdown),a|=["-","="].indexOf(r[1][0])>-1,a&=LANGUAGE_REG.test(e.body_markdown)}catch(n){}return a}function shouldHaveScore(e){var a=!1;try{a|=SIZE_REG.test(e.body_markdown.split("\n")[0])}catch(r){}return a}function getAuthorName(e){return e.owner.display_name}function process(){answers=answers.filter(shouldHaveScore).filter(shouldHaveHeading),answers.sort(function(e,a){var r=+(e.body_markdown.split("\n")[0].match(SIZE_REG)||[1/0])[0],n=+(a.body_markdown.split("\n")[0].match(SIZE_REG)||[1/0])[0];return r-n});var e={},a=1,r=null,n=1;answers.forEach(function(s){var t=s.body_markdown.split("\n")[0],o=jQuery("#answer-template").html(),l=(t.match(NUMBER_REG)[0],(t.match(SIZE_REG)||[0])[0]),c=t.match(LANGUAGE_REG)[1],i=getAuthorName(s);l!=r&&(n=a),r=l,++a,o=o.replace("{{PLACE}}",n+".").replace("{{NAME}}",i).replace("{{LANGUAGE}}",c).replace("{{SIZE}}",l).replace("{{LINK}}",s.share_link),o=jQuery(o),jQuery("#answers").append(o),e[c]=e[c]||{lang:c,user:i,size:l,link:s.share_link}});var s=[];for(var t in e)e.hasOwnProperty(t)&&s.push(e[t]);s.sort(function(e,a){return e.lang>a.lang?1:e.lang<a.lang?-1:0});for(var o=0;o<s.length;++o){var l=jQuery("#language-template").html(),t=s[o];l=l.replace("{{LANGUAGE}}",t.lang).replace("{{NAME}}",t.user).replace("{{SIZE}}",t.size).replace("{{LINK}}",t.link),l=jQuery(l),jQuery("#languages").append(l)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",answers=[],page=1;getAnswers();var SIZE_REG=/\d+(?=[^\d&]*(?:<(?:s>[^&]*<\/s>|[^&]+>)[^\d&]*)*$)/,NUMBER_REG=/\d+/,LANGUAGE_REG=/^#*\s*([^,]+)/;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Great idea! Here some thoughts: Please define the number of cells per subtape, and the number of subtapes we should use in our implementations (or specify whether it should be some sort of adaptive/infinite). How should an input string be converted to numbers 0-255? ASCII codes perhaps?

Python2, 748 736 731 709 704 691 bytes
This was a fun little challenge, I am sure I can make this code even shorter (maybe I'll do that at some point later).
from sys import*
w=stdout.write
p=open(argv[1],'r').read()
c,r,s,x,y,t,o=0,0,256,0,0,0,0
g=[[0]*s]*s
e=lambda d:p.find(d,c+1)
def h(i,j=0,k=0):global c,x,y;c+=1;n=1+(int(p[c])-1)%10;l=g[x][y]+n*i;g[x][y]=l%s;o=l/s;x=(x+n*j)%s;y=(y+n*k)%s
a="g[x][y]"
b="[p[c+1:i]]"
l={}
f={}
d={'0':a+"=0",'{':"if "+a+"<1:c=e('}')",'(':"i=stdin.read(1);"+a+"=ord(i)if i else 0",')':"w(chr("+a+"))",'x':"t="+a,'o':"w(chr(t))",'!':a+"+=o",'?':a+"=0if "+a+"else 1",'+':"h(1)",'-':"h(-1)",'^':"h(0,1)",'V':"h(0,-1)",'<':"h(0,0,-1)",'>':"h(0,0,1)",':':"i=e(':');l"+b+"=i;c=i",'*':"i=e('*');c=l"+b,'~':"i=e('~');f"+b+"=i;c=e('%')",'@':"i=e('@');r=i;c=f"+b,'%':"c=r"}
while c<len(p):
    if p[c]in d:exec d[p[c]]
    c+=1

This implementation requires for labels and functions to be declared (implemented) before being called. It works perfectly with the two tests given but it unfortunately doesn't work with the "SayHi.2b" program written by the author of the language (even after changing the order of declaration of the functions). I think this problem might have to do with the way I understood the tape and subtape system. When moving along the main tape, is the position on the corresponding subtape reset to 0? At the moment I am keeping the position on the subtape even when moving on the main tape.
Here is the more readable version:
#!/usr/bin/python

import sys
w=sys.stdout.write
p=open(sys.argv[1],'r').read()
c,r,s,x,y,t,o=0,0,256,0,0,0,0
# c is the current index in the program string
# r is the return index (for functions)
# s is the size of the tape, subtapes and modulo for ints (max int will be 255)
# x and y are the coordinates in the grid
# t is the temporary register
# o is overflow
g=[[0]*s]*s # initialise a grid 256x256 with 0

e=lambda d:p.find(d,c+1)
def n():global c;c+=1;i=int(p[c]);return i if i>0 else 10 # get the number specified
def h(i):j=g[x][y]+i;g[x][y]=j%s;o=j/s # handle addition and substraction
def m(i,j):global x,y;x=(x+i)%s;y=(y+j)%s # move current cell

a="g[x][y]" # string of current cell
b="[p[c+1:i]]" # key for label or function
l={} # dictionary of labels
f={} # dictionary of functions
d={'0':a+"=0",
   '{':"if "+a+"<1:c=e('}')",
   '(':"i=sys.stdin.read(1);"+a+"=ord(i)if i else 0",
   ')':"w(chr("+a+"))",
   'x':"t="+a,
   'o':"w(chr(t))",
   '!':a+"+=o",
   '?':a+"=0if "+a+"else 1",
   '+':"h(n())",
   '-':"h(-n())",
   '^':"m(n(),0)",
   'V':"m(-n(),0)",
   '<':"m(0,-n())",
   '>':"m(0,n())",
   ':':"i=e(':');l"+b+"=i;c=i",
   '*':"i=e('*');c=l"+b,
   '~':"i=e('~');f"+b+"=i;c=e('%')",
   '@':"i=e('@');r=i;c=f"+b,
   '%':"c=r",
   '#':"c=e('#')"
   }

while c<len(p): # loop while c is not EOF
    # print c, p[c]
    if p[c]in d:exec d[p[c]] # execute code kept as a string
    c+=1 # increment index

Edit: Take into account the comments handling (-10 bytes), fixing an off by one error. This implementation doesn't support nested function calls (I could implement it if it is a required feature)
Edit2: Changed the handler function to do addition, substraction and cell movement. More lambdas! :D (The "more readable version" may be out of sync now)
Edit3: I just realized that handling comments costs me 5 bytes (taking into account the -10). So I just removed it, it's shame it now feels incomplete.
Edit4: moved definition of n from lambda to var inside the handler h()

with so many +a+ might it be better to join by a? It would also get rid of you having to assign it to a var.

Well except I can't join the strings in a dictionary as a whole and it wouldn't be worth doing so for each string separately. Assigning the string to a is just a trick to gain some bytes nothing actually useful for the code.

I guess I can't complain about the order of functions, as I didn't actually specify that, but try to get the SayHi.2b file working. What happens if it is changed to reset the subtape to zero on a shift?


text:
Convert a date to xkcd notation
In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:

The large numbers are all the digits that appear in the current date in their usual order, and the small numbers are 1-based indices of the occurrences of that digit. So the above example represents 2013-02-27.
Let's define an ASCII representation for such a date. The first line contains the indices 1 to 4. The second line contains the "large" digits. The third line contains the indices 5 to 8. If there are multiple indices in a single slot, they are listed next to each other from smallest to largest. If there are at most m indices in a single slot (i.e. on the same digit, and in the same row), then each column should have be m+1 characters wide and left-aligned:
2  3  1  4
0  1  2  3  7
5     67    8

See also the companion challenge for the opposite conversion.
The Challenge
Given an ISO 8601 date (YYYY-MM-DD), output the corresponding xkcd date notation.
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
Any year from 0000 to 9999 is valid input.
Trailing spaces are allowed, leading spaces are not. You may optionally output a single trailing newline.
Standard code-golf rules apply.
Test Cases
2013-02-27
2  3  1  4
0  1  2  3  7
5     67    8

2015-12-24
2  3  1     4
0  1  2  4  5
   5  67 8

2222-11-11
     1234
1    2
5678

1878-02-08
   1     3  24
0  1  2  7  8
57    6     8

2061-02-22
2   4   1   3
0   1   2   6
5       678

3564-10-28
      1 4 2 3
0 1 2 3 4 5 6 8
6 5 7         8

1111-11-11
1234
1
5678

0123-12-30
1 2 3 4
0 1 2 3
8 5 6 7

Pyth, 86 78 bytes
JS{K-z\-=GheS.nmmlkd=N,mf<T5d=ZmmhkxdcK1Jmf>T4dZjbmjkmj"".[|k\ \ Gd[hNm]dcJ1eN

I will try to golf this down as soon as my brain has recovered. I was happy just to see it work.

JavaScript (ES6), 168 173
As an anonymous function. Using template strings, there is a newline near the end that is significant and included in the byte count.
d=>d.replace(/\d/g,c=>m=(l=((o[c]=o[c]||[b,c,b])[p/2&~1]+=++p).length)>m?l:m,t=[m=p=b='',b,b],o=[])&o.map(x=>x&&x.map((x,i)=>t[i]+=(x+'     ').slice(0,m+1)))||t.join`
`

Less golfed
f=d=>(
  // get the indices in o and the columns width in m
  m=0,
  p=0,
  o=[],
  d.replace(/\d/g,c=>(
    o[c] = o[c]||['',c,''], // for each found digit :array with top indices, digit, bottom indices
    o[c][p/2 & ~1] += ++p, // (p/2 and not 1) maps 0..3 to 0, 4..7 to 2
    l = o[c].length,
    m = l>m ? l : m // max indices string length in m
  )),
  // build the output in t
  t=['','',''],
  o.map(x=> x && x.map(
    (x,i) => t[i]+=(x+'     ').slice(0,m+1)) // left justify, max value of m is 4
  ),
  t.join`\n` // return output as a newline separated string
)

Test snippet

f=d=>
  d.replace(/\d/g,c=>m=(l=((o[c]=o[c]||[b,c,b])[p/2&~1]+=++p).length)>m?l:m,t=[m=p=b='',b,b],o=[])&
  o.map(x=>x&&x.map((x,i)=>t[i]+=(x+'     ').slice(0,m+1)))
  ||t.join`\n`

console.log=x=>O.textContent+=x+'\n'

;['2013-02-27','2015-12-24','2222-11-11','1878-02-08','2061-02-22','3564-10-28','1111-11-11']
.forEach(t=>console.log(t+'\n'+f(t)+'\n'))

Oh, good additional test case. I'll add that to both challenges.

Ruby, 200 195 189 178 162 157 characters
(156 characters code + 1 character command line option)
o={}
i=0
$_.gsub(/\d/){o[$&]||=['','']
o[$&][i/4]+="#{i+=1}"}
o=o.sort.map &:flatten
puts [1,0,2].map{|i|o.map{|c|c[i].ljust o.flatten.map(&:size).max}*' '}

Sample run:
bash-4.3$ ruby -n xkcd-date.rb <<< '2013-02-27'
2  3  1  4
0  1  2  3  7
5     67    8

bash-4.3$ ruby -n xkcd-date.rb <<< '2222-11-11'
     1234
1    2
5678

bash-4.3$ ruby -n xkcd-date.rb <<< '3564-10-28'
      1 4 2 3
0 1 2 3 4 5 6 8
6 5 7         8

Python 2.7, 308 310 bytes
i=raw_input().replace("-","")
s,w=sorted(set(i)),len
x,m={},0
for c in s:
    q,v=i,[""]*2
    while c in q:a=str(-~q.index(c)+(w(i)-w(q)));v[int(a)>4]+=a;q=q[q.index(c)+1:]
    m,x[c]=max(m,max(map(w,v))),v
for l in[0,1]:print"".join((lambda x:x+(-~m-w(x))*" ")("".join(x[n][l]))for n in s)+"\n"+(" "*m).join(s)*(-l+1)

Wow, fixing it only costed 2 bytes!
The date doesn't have to be separated, the date can be any length, it doesn't have to be a date, it could be any string (but dashes are removed). The middle part looks pretty golfable to me.

Python 3, 306 bytes
I'm investigating ways to determine, before assembling the top and bottom lines, what the maximum width of any given column will be. Once I've got that, I should be able to build the spaces into the lines directly instead of using all those join functions.
j=''.join
def t(d):
 c,*l={},;i,*n=0,
 for e in d.replace('-',''):
  i+=1
  try:c[e]+=[i]
  except:c[e]=i,
 m=sorted(c)
 for x in m:
  l+=[j(str(p)for p in c[x]if p<5)]
  n+=[j(str(p)for p in c[x]if p>4)]
 f='<'+str(max(map(len,l+n)))
 return'\n'.join(map(lambda o:' '.join(format(i,f)for i in o),(l,m,n)))

Couldn't you save ''.join to a variable?

@Dennis: Huh. I wonder why I'd never thought of that. Maybe because I was subconsciously treating ''.join(...) as join('',...), which would need to be "saved" as a function instead.

I think +=[i] can be +=i,.

return '\n' -> return'\n'.

@JonathanFrech: Good catch on the second one. For the first, it can't, because a list's += works like extend, not append.

@TimPederick Are you sure? (Note the comma!)

@JonathanFrech: Hmm. I think I must've typed it in without the comma before, because it definitely didn't work when I ran it. But now it does. Thanks!

C#, 456
Golfed:
string  x(string p){string s=p.Replace("-", ""),a="",d="",e="";var u=new Dictionary<char,List<int>>();for(int i=0;i<s.Length;i++)if(u.ContainsKey(s[i]))u[s[i]].Add(i+1);else u.Add(s[i],new List<int>{i+1});foreach (var c in u.Keys.OrderBy(k=>k)){var t=String.Join("",u[c].Where(i=>i<5));var b=String.Join("",u[c].Where(i=>i>4));var l=Math.Max(t.Length,b.Length);var m=c+"".PadRight(l);a+=t.PadRight(l)+" ";e+=m;d+=b.PadRight(l)+" ";}return a+"\n"+e+"\n"+d;}

Ungolfed:
string  x(string p)
    {
        string s = p.Replace("-", ""),a = "", d = "", e = "";;
        var u = new Dictionary<char, List<int>>();
        for (int i = 0; i < s.Length; i++) if (u.ContainsKey(s[i])) u[s[i]].Add(i + 1); else u.Add(s[i], new List<int>{ i + 1 });
        foreach (var c in u.Keys.OrderBy(k => k))
        {
            var t = String.Join("", u[c].Where(i => i < 5));
            var b = String.Join("", u[c].Where(i => i > 4));
            var l = Math.Max(t.Length, b.Length);
            var m = c + "".PadRight(l);
            a += t.PadRight(l) + " ";
            e += m;
            d += b.PadRight(l) + " ";
        }
        return a + "\n" + e + "\n" + d;
    }

Perl6, 265 bytes
Golfed
my$i=get;$i~~s:g/\-//;my@b=$i.comb.unique.sort;my$f={$i.comb[$_[1]-1]eq$_[0]??$_[1]!!''};my$g={[~] .map: $f};my$h={(@b X @^a).rotor(4).map: $g}my@a=$h(1..4);my@c=$h(5..8);my$s=max(|@a».chars,|@c».chars)+1;my$x='%-'~$s~'s';for @a,@b,@c {say [~] @_.map: *.fmt($x)}

Ungolfed (slightly)
my $i = get;
$i ~~ s:g/\-//;
my @b = $i.comb.unique.sort;
my $f = { $i.comb[$_[1]-1] eq $_[0] ?? $_[1] !! '' };
my $g = { [~] .map: $f };
my $h = { (@b X @^a).rotor(4).map: $g }
my @a = $h(1..4);
my @c = $h(5..8);
my $s = max(|@a».chars, |@c».chars)+1;
my $x = '%-'~$s~'s';
for @a,@b,@c { say [~] @_.map: *.fmt($x) }

Powershell, 174 170 168 167 bytes
$a=@{}
$args|% t*y|?{$_-45}|%{if(!$a.$_){$a.$_="","","$_"}$a.$_[++$i-gt4]+=$i}
0,2,1|%{$r=$_
-join($a.Keys|sort|%{$a.$_[$r]}|% p*ht(1+($a|% v*|%{$_|% l*h}|sort)[-1]))}

Less golfed test script:
$f = {

$a=@{}                              # a hash table for a result
$args|% toCharArray|?{$_-45}|%{     # for each digit from argument strings except a '-'
    if(!$a.$_){$a.$_="","","$_"}    #   create an array if there are no values for the current digit
    $a.$_[++$i-gt4]+=$i             #   append the character to the relative row (0 - top, 1 - bottom) and increment position number
}                                   # the result is a hash table in which the key is a char of a digit and the value is an array of string
                                    # for example, first lines for the first test case:
                                    # @{
                                    #     [char]48: ("2","5","0")
                                    #     [char]49: ("3","","1")
                                    #     [char]50: ("1","67","2")
                                    #     ...
                                    # }
$l=1+($a|% Values|%{$_|% Length}|sort)[-1]      # calc the maximum width of strings
0,2,1|%{                            # for each number 0,2,1
    $r=$_                           # store it as row number
    -join(
        $a.Keys|sort|               # for each keys (digit of the dates) in the sorted order
            %{$a.$_[$r]}|           # push to pipe the relative string
            % padRight $l           # for which to execute the 'padright' method to pad with spaces
    )                               # and finally join the row
}

}

@(

,("2013-02-27",
"2  3  1  4   ",
"0  1  2  3  7",
"5     67    8")

,("2015-12-24",
"2  3  1     4",
"0  1  2  4  5",
"   5  67 8   ")

,("2222-11-11",
"     1234 ",
"1    2    ",
"5678      ")

,("1878-02-08",
"   1     3  24 ",
"0  1  2  7  8  ",
"57    6     8  ")

,("2061-02-22",
"2   4   1   3 ",
"0   1   2   6 ",
"5       678   ")

,("3564-10-28",
"      1 4 2 3   ",
"0 1 2 3 4 5 6 8 ",
"6 5 7         8 ")

,("1111-11-11",
"1234 ",
"1    ",
"5678 ")

,("0123-12-30",
"1 2 3 4 ",
"0 1 2 3 ",
"8 5 6 7 ")

) | % {
    $d, $expected = $_
    $result = &$f $d

    $d
    $j=0
    $result|%{
        "$($_.trimEnd() -eq $expected[$j].TrimEnd()): |$_|"   # Vertical bars only to see trailing and leading spaces
        $j++
    }
}

Output (vertical bars only to see trailing and leading spaces):
2013-02-27
True: |2  3  1  4     |
True: |0  1  2  3  7  |
True: |5     67    8  |
2015-12-24
True: |2  3  1     4  |
True: |0  1  2  4  5  |
True: |   5  67 8     |
2222-11-11
True: |     1234 |
True: |1    2    |
True: |5678      |
1878-02-08
True: |   1     3  24 |
True: |0  1  2  7  8  |
True: |57    6     8  |
2061-02-22
True: |2   4   1   3   |
True: |0   1   2   6   |
True: |5       678     |
3564-10-28
True: |      1 4 2 3   |
True: |0 1 2 3 4 5 6 8 |
True: |6 5 7         8 |
1111-11-11
True: |1234 |
True: |1    |
True: |5678 |
0123-12-30
True: |1 2 3 4 |
True: |0 1 2 3 |
True: |8 5 6 7 |

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Read a date in xkcd notation
In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation:

The large numbers are all the digits that appear in the current date in their usual order, and the small numbers are 1-based indices of the occurrences of that digit. So the above example represents 2013-02-27.
Let's define an ASCII representation for such a date. The first line contains the indices 1 to 4. The second line contains the "large" digits. The third line contains the indices 5 to 8. If there are multiple indices in a single slot, they are listed next to each other from smallest to largest. If there are at most m indices in a single slot (i.e. on the same digit, and in the same row), then each column should have be m+1 characters wide and left-aligned:
2  3  1  4
0  1  2  3  7
5     67    8

See also the companion challenge for the opposite conversion.
The Challenge
Given a date in xkcd-notation, output the corresponding ISO 8601 date (YYYY-MM-DD).
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
You may assume that the input is any valid date between years 0000 and 9999, inclusive.
There won't be any leading spaces in the input, but you may assume that the lines are padded with spaces to a rectangle, which contains at most one trailing column of spaces.
Standard code-golf rules apply.
Test Cases
2  3  1  4
0  1  2  3  7
5     67    8
2013-02-27

2  3  1     4
0  1  2  4  5
   5  67 8
2015-12-24

     1234
1    2
5678
2222-11-11

   1     3  24
0  1  2  7  8
57    6     8
1878-02-08

2   4   1   3
0   1   2   6
5       678
2061-02-22

      1 4 2 3
0 1 2 3 4 5 6 8
6 5 7         8
3564-10-28

1234
1
5678
1111-11-11

1 2 3 4
0 1 2 3
8 5 6 7
0123-12-30

People who write the date in the "black cat" format are the bane of my existence.

Forgive my ignorance, but how exactly does the weird format correspond with the date? Can't for the life of me work out the pattern.

@TomCarpenter The bottom and top line indicate where the numbers in the middle line appear in the date. E.g. 1 is above 2, so the first digit is 2. 2 is above 0, so the second digit is 0. 3 is above 1, 4 is above 3, so we get 2013 as the first four digits. Now 5 is below 0, so the fifth digit is 0, 6 and 7 are both below 2, so both of those digits are 2. And finally, 8 is below 7, so the last digit is 8, and we end up with 2013-02-27. (The hyphens are implicit in xkcd notation because we know at what positions they appear.)

CJam, 35 bytes
ll{1$e>}*](l+eeWf%$-8>Wf=\f=2/(o'-*

Try it here. It expects the input lines to be padded with spaces.
Explanation
ll reads two lines of input, and {1$e>}* performs a "scan" on the second one: it it takes all prefixes of its input and computes the maximum of each prefix. For the input line "0  1  2  7  8", this pushes "0001112227778". Our stack now looks like this:
"first line" '0 '0 '0 '1 '1 '1 ...

We need to re-capture the values into a list ourselves using ]; this captures our first line as well, so we pop it back out using (, to get
"0001112227778" "first line"

as expected.
eelee+ enumerates this line, then does the same for a third input line, and concatenates the results, leaving something like this on the top of the stack:
[[0 '5] [1 ' ] [2 ' ] [3 ' ] [4 ' ] [5 ' ] [6 ' ] [7 ' ] [8 '6] [9 '7] [10 '8] [11 ' ] [12 ' ]
 [0 '2] [1 ' ] [2 ' ] [3 ' ] [4 '4] [5 ' ] [6 ' ] [7 ' ] [8 '1] [9 ' ] [10 ' ] [11 ' ] [12 '3]]

Now our stack is ["0001112227778" X] where X is the enumerated list above.
We flip each pair in X (Wf%), sort the pairs lexicographically ($), and leave the last 8 pairs -8>. This gets us something like:
[['1 8] ['2 0] ['3 12] ['4 4] ['5 0] ['6 8] ['7 9] ['8 10]]

This works, because the sort places all the pairs with key ' (space) before all the digits in ascending order.
These are the "x-positions" of the characters 12345678 on the first and third lines: we only need to retrieve the characters from our (modified) second line that are vertically aligned with them.
To do this, we take each position (Wf=), index into the string we made earlier (\f=). We have "20610222" on the stack now: to add the dashes, first we split into segments of length two (2/), print the first segment without a newline ((o) and join the remaining segments with dashes ('-*).
EDIT: cool scan trick, Martin! Saved four bytes.
EDIT 2: saved two more bytes by replacing eelee+ with l+ee; this works, because the lines all have the same lengths, and list indexing in CJam is automatically modulo the list length, so the indices n+0, n+1, n+2... nicely map to 0, 1, 2...
EDIT 3: Martin saved another byte in the final step of the process. Nice!

Pyth, 48 43
j\-cj\-ctuuXN.xsTZK?qJhtHdKJ+hHeHGC.z*9d4 7

Test Suite
Requires padding with spaces into a rectangle.
I don't think this is the best approach, but basically it writes the middle value to the index in a string pointed at by the top or bottom value. Well I guess I had enough time to golf most of the obvious stuff I saw. :P

JavaScript (ES7), 115
Anonymous function. Using template strings, there is a newline that is signifiocant and included in byte count.
Requirement: the middle input line cannot to be shorter than the first or the last. This requirement is satisfied when the input is padded with spaces to form a rectangle.
x=>([a,z,b]=o=x.split`
`,d=i=0,[for(c of z)o[a[i]-1]=o[b[i++]-1]=d=+c||d],o.splice(4,2,'-',o[4],o[5],'-'),o.join``)

ES6 version 117 using .map instead of array comprehension
x=>([a,z,b]=o=x.split`
`,d=0,[...z].map((c,i)=>o[a[i]-1]=o[b[i]-1]=d=+c||d],o.splice(4,2,'-',o[4],o[5],'-'),o.join``)

Less golfed
x=>(
  o=[],
  [a,z,b] = x.split`\n`,
  d=i=0,
  [ for(c of z) (
      d = +c||d, // each new digit found in z goes in d (but not the spaces and not the '0' (d starts at 0 anyway)
      o[a[i]-1] = o[b[i]-1] = d, // if the index char is space, that gives index -1 that is ignored when joining later
      ++i
  )],
  o.splice(4,2,'-',o[4],o[5],'-'), // add the dashes in the right places
  o.join``
)

Test snippet

f=x=>(
  [a,z,b]=o=x.split`\n`,
  d=i=0,[for(c of z)o[a[i]-1]=o[b[i++]-1]=d=+c||d],
  o.splice(4,2,'-',o[4],o[5],'-'),o.join``
)

console.log=x=>O.textContent+=x+'\n';

[['2  3  1  4\n0  1  2  3  7\n5     67    8','2013-02-27']
,['2  3  1     4\n0  1  2  4  5\n   5  67 8','2015-12-24']
,['      1234\n1     2   \n5678','2222-11-11']
,['   1     3  24\n0  1  2  7  8 \n57    6     8','1878-02-08']
,['2   4   1   3\n0   1   2   6  \n5       678','2061-02-22']
,['      1 4 2 3\n0 1 2 3 4 5 6 8\n6 5 7         8','3564-10-28']
,['1234\n1   \n5678','1111-11-11']
,['1 2 3 4\n0 1 2 3\n8 5 6 7','0123-12-30']]
.forEach(t=>(k=t[1],r=f(t[0]),console.log(t[0]+'\n'+r+'\n'+(r==k?'OK\n':'Fail\n'))))

Congrats on being the first to solve both challenges. :)

Haskell, 125 106 103 bytes
a#' '=a
a#b=b
f i|[a,b,c]<-('-':)<$>lines i=[o|m<-"1234-56-78",(n,o,p)<-zip3 a(scanl1(#)b)c,m==n||m==p]

Requires padding with spaces to a full rectangle.
Usage example: f "   1     3  24\n0  1  2  7  8 \n57    6     8 " -> "1878-02-08".
How it works:
[a,b,c]<-('-':)<$>lines i          -- split input into lines, prepend a '-' to
                                   -- each, call them a, b and c
               (scanl1(#)b)        -- fill spaces of the middle line with the
                                   -- previous char, e.g.
                                   -- "-0  1  2  7  8 " -> "-00011122277788"
        zip3 a (scanl...) c        -- combine the lines element wise into triples.
                                   -- This is our lookup table for "1234-56-78"
o|m<-"1234...",  (n,o,p)<-zip...,  m==n||m==p
                                   -- whenever m equals n or p (i.e. was originally
                                   -- in the first or last line), take the
                                   -- corresponding char o (middle line)

JavaScript ES6, 231
a=>{r=[];var b=[d,f,e]=a.split`
`.map(n=>n.split``);Array(Math.max(...b.map(n=>n.length))).fill().map((m,i)=>{(m=f[i])&&m!=" "&&(c=m);[d,e].map(m=>(g=m[i])&&g!=" "&&(r[g-1]=c))}),r.splice(4,0,"-"),r.splice(7,0,"-");return r.join``}

Test cases.

Perl, 154 bytes
sub{$_=$_[1];@n=/\d/g;/ +/;map{map{$p[$i++].=$_}unpack"(a$+[0])*";$i=0}@_[0,2];map{map{$r[$_-1]=$n[$i]if/\d/}s plit$"='';$i++}@p;"@r"=~s/....\K(..)/-$1-/r}

Ungolfed & explained
sub{
    $_=$_[1]; # $_[1] is 2nd argument (i.e., 2nd line)
    @n=/\d/g; # @n now contains all digits in 2nd line
    / +/;     # $+[0] now the chunk length in 2nd line
              # Equivalent to /( +)/;$l = 1 + length $1;
    map{      # Perl golfer's for-loop
        map{
            $p[$i++] .= $_    # @p contains positions of each digit
        } unpack "(a$+[0])*"; # Split line into same chunk width
        $i=0 # At end of loop so we don't need $i=0 before next one
    } @_[0,2];# Outer map works on 1st and 3rd lines
    map{
        map{
            # Shove $n[$i] into ($_-1)th slot in @r if $_ is a number
            $r[$_-1] = $n[$i] if /\d/
        } split $"=''; # Equivalent to split '', but sets $"='' for free
        $i++
    }@p;
    # Concatenate @r, convert 20130227 to 2013-02-27, and return
    "@r"=~s/....\K(..)/-$1-/r
};

JavaScript (ES6), 131 bytes
s=>[...(r=[,,,,"-",,,"-"],l=s.split`
`)[1]].map((c,i)=>(c>"-"?n=c:0,y=+l[0][i],d=+l[2][i],y?r[y-1]=n:0,d?r[d+(d>6)]=n:0))&&r.join``

Explanation
Requires input to be padded with spaces to form a rectangle.
s=>
  [...(
    r=[,,,,"-",,,"-"], // r = array of result characters, prefill with "-" symbols
    l=s.split`
`                      // l = array of lines
  )[1]].map((c,i)=>(   // for each character on the middle line
    c>"-"?n=c:0,       // n = the most recent digit encountered
    y=+l[0][i],        // y = index on the year line at the current position
    d=+l[2][i],        // d = index on the date line at the current position
    y?r[y-1]=n:0,      // if y is a number, put n at the index y of the result
    d?r[d+(d>6)]=n:0   // if d is a number, put n at the index d (accounting for "-"s)
  ))
  &&r.join``           // return the result as a string

Test

var solution = s=>[...(r=[,,,,"-",,,"-"],l=s.split`
`)[1]].map((c,i)=>(c>"-"?n=c:0,y=+l[0][i],d=+l[2][i],y?r[y-1]=n:0,d?r[d+(d>6)]=n:0))&&r.join``
<textarea id="input" rows="3" cols="30">   1     3  24
0  1  2  7  8
57    6     8 </textarea>

<button onclick="result.textContent=solution(input.value)">Go</button>

Jelly, 38 bytes
Ỵṙ-Zn⁶Ṫ€œṗƊḊZḟ⁶V€$€;2/p/Ʋ€ẎṢṪ€s2Ḣ;jɗ”-

Try it online!
The helper is only there to make input easier; this is actually a full program. Be sure to care for:

The first and last lines ('''), as well as the lines next to them (empty, there for clarity).

The actual input format doesn't have the second and penultimate empty lines, and the string starts and ends directly next to the quotes, without a newline in-between, like this:'''   1     3  24
0  1  2  7  8
57    6     8 '''You can leave the footer in while using this format. This is really a Python multi-line string, and the quotes are necessary for some inputs.

Pad the input with trailing spaces! Any correct output without correctly padded input is entirely coincidental, and isn't endorsed by me.

Powershell, 119 bytes
$r=,'-'*99
($a=$args-split'
')[1]|% t*y|%{if($_-32){$d=$_}
$a[0,2]|%{$r[$_[+$p]-48]=$d}
$p++}
-join$r[1..4+0+5+6+0+7+8]

Ungolfed test script:
$f = {

$r=,'-'*99                       # init a result as an array of '-' repeated 99 times
($a=$args-split"`n")[1]|% t*y|%{ # split argument string, store a top, middle and bottom to $a, then for each char of the middle line...
    if($_-32){$d=$_}             # store a digit to $d if the current character of the middle is not a space
    $a[0,2]|%{                   # for the top and the bottom lines...
        $r[$_[+$p]-48]=$d        # store a digit to the result array
    }                            # Note: if char in the current position is a space, then expression $_[+$p]-48 less then 0.
                                 # In this case, the expression $r[32-48]=$d changes unused element in a end of the array.
                                 # That is why the array was created by a large.
    $p++                         # next position
}
-join$r[1..4+0+5+6+0+7+8]        # return joined char with specified numbers
                                 # Note: element with index 0 has value '-'
}

@(
,(@"
2  3  1  4
0  1  2  3  7
5     67    8
"@,"2013-02-27")

,(@"
2  3  1     4
0  1  2  4  5
    5  67 8
"@,"2015-12-24")

,(@"
     1234
1    2
5678
"@,"2222-11-11")

,(@"
1     3  24
0  1  2  7  8
57    6     8
"@,"1878-02-08")

,(@"
2   4   1   3
0   1   2   6
5       678
"@,"2061-02-22")

,(@"
      1 4 2 3
0 1 2 3 4 5 6 8
6 5 7         8
"@,"3564-10-28")

,(@"
1234
1
5678
"@,"1111-11-11")

,(@"
1 2 3 4
0 1 2 3
8 5 6 7
"@,"0123-12-30")

) | % {
    $a,$expected = $_
    $result = &$f $a
    "$(""$result"-eq"$expected"): $result"
}

Output:
True: 2013-02-27
True: 2015-12-24
True: 2222-11-11
True: 1878-02-08
True: 2061-02-22
True: 3564-10-28
True: 1111-11-11
True: 0123-12-30


text:
Hexadecimal and the Alphabet
In this challenge, you will receive an input, convert it to hexadecimal, make a couple changes, and output the result.
Because they are only 16 characters in hexadecimal, your code will need to be as short as possible.

Examples
Examples are separated by a blank line. First line is input, second line shows the steps, third shows the output
234589
234589 -> 3945D -> 39454 -> 9A1E -> 9115 -> 239B -> 2392 -> 958
958

435234
435234 -> 6A422 -> 61422 -> EFEE -> 5655 -> 1617
1617

153
153 -> 99 -> 99 -> 63
1617

Steps
The input will always be a positive integer

In order to generate the output you will follow the following steps:

Convert the input to hexadecimal
Replace any letters with their index in the alphabet (e.g. a -> 1, b -> 2)
Convert the result back to hexadecimal
If the result contains any letters, go to step 2. If not, output the result

This is code-golf so shortest code in bytes wins!

+1 for the justification "Because they are only 16 characters in hexadecimal, your code will need to be as short as possible."

A test case that passes through a zero digit (which is an important edge case for my current approach): 749699 -> B7083 -> 27083 -> 69CB -> 6932 -> 1B14 -> 1214 -> 4BE -> 425 -> 1A9 -> 119 -> 77

Test case 153. Step 1 > 99, Step 2 --> 99, Step 3 --> 63, output 63. Correct?

Yes for 153 I had not seen the code Flow explanation...

For what it's worth... 3 out of the top 4 answers return 99 on input 153 and Dennis's seg-faults on the current version of Jelly. I'm going to quit testing while I'm ahead :) Are we sure that example is correct?

Jelly, 18 bytes
b⁴µ:⁵©+¹%⁵ḅ⁵ß¹®S¤?

Try it online!
The binary, 18 byte version of the source code has the xxd dump
0000000: 62 b6 8c 3a b7 85 2b 8e 25 b7 a3 b7 95 8e 88 53 83 3f b..:..+.%......S.?

and works with this version of the Jelly interpreter.
How it works
b⁴µ:⁵©+¹%⁵ḅ⁵ß¹®S¤?  Define the main link -- Left input: a (number)

b⁴                  Convert from integer to base 16.
  µ                 Start a new, monadic link.
   :⁵               Divide all base 16 digits by 10.
     ©              Save the result in a register.
      +¹            Add the quotients to the base 16 digits.
        %⁵          Take all resulting sums modulo 10.
          ḅ⁵        Convert from base 10 to integer.
              ®S¤   Take the sum of the quotients from the list in the register.
                 ?  If the result is non-zero:
            ß         Recursively call the main link.
             ¹        Else, apply the identity function.

Ḍ (decimal-to-integer) should have worked as a shorthand for ḅ⁵, but the latest version of Jelly at the time of this post had a bug that prevented me from using it.

What....is.....that....?

Which encoding does this use? It doesn't look like UTF-8, or ISO-8859

@Downgoat It isn't. Jelly uses its own, custom encoding. The source code can be provided either in UTF-8 or as a binary file.

@Dennis: Please provide documentation of that encoding, and preferably, the language too. Perhaps write an esolangs wiki article on it? That will increase its visibility too :)

@Timwi Documentation is work in progress. I haven't documented the encoding yet, since it is still changing with every commit. The same goes for pretty much all other features...

@Timwi It's in this file: code = ''.join([char_table[i] for i in code])

@Dennis: Yes, found it now. I think you’re making it too easy for yourself. You just put a line in your parser so that it can theoretically read a binary format in which each character is one byte, but you didn’t actually write your program in it. You wrote it in a Unicode-enabled editor using Unicode characters. You did not post the binary file that is actually 18 bytes, and even if you did, it will become invalid with every new instruction you add to the language.

@Timwi Re scoring, how is that different from every single APL answer on this site? Nobody actually uses the APL code page... The source code in the custom encoding is 0000000: 62 b6 8c 3a b7 85 2b 8e 25 b7 a3 b7 95 8e 88 53 83 3f  b..:..+.%......S.? (xxd dump). It is only changing since the language is currently under development. The char table will be fixed later.

@Dennis: APL has a fixed, published, known encoding. I didn’t say you can’t score one character per byte; I just think you should post the answer that is actually 18 bytes in order to claim 18 bytes, and if you want to change the encoding in your interpreter, then your answer should state which old version of the interpreter understands the encoding you used in the answer.

@Timwi Fair enough. I've added both to the post.

In the defense of Dennis: since Jelly uses less than 256 chars, one could trivially define a fork of Jelly that just uses ANSI chars. The only difference would be readability and ease of remembering what each function does.

Actual link make jelly interpreter to segfault... There would be in the text what jelly version and the link point to that version...or not use a link

JavaScript ES6, 98 92 67 64 bytes
Saved 3 bytes thanks to @Downgoat, 3 more thanks to @user81655
Found a much, much shorter version, ditching the loop for recursion:
h=x=>(y=x.toString(16))>(r=y.replace(/\D/g,z=>'0x'+z-9))?h(+r):r

Probably the most interesting part of this program is the replace function:
z=>     // Implicit: z = one of "a", "b", "c", "d", "e", "f"
'0x'+z  // Add '0x' to the beginning of z.
        // If z == "a", this results in "0xa".
-9      // Subtract 9. JavaScript automatically coerces the string to a number,
        // and because the prefix "0x" means "convert from hexadecimal",
        // the "a" is converted to 10, which then becomes 1 because of the subtraction.

Test snippet
(taken from here)

h=x=>(y=x.toString(16))>(r=y.replace(/\D/g,z=>'0x'+z-9))?h(+r):r

Code:
<textarea id="textbox" style="margin-top:5px; margin-bottom:5px"></textarea>

Input:
<textarea id="inputbox" style="margin-top:5px; margin-bottom:5px"></textarea>
<button id="testbtn">Test!</button><button id="resetbtn">Reset</button>

Original Code Output:

New Code Output:

It'll save a few bytes to use a function for .toString(16): x=>eval("for(x=(j=n=>n.toString(16))(x);/\\D/.test(x);)x=j(+x.replace(/\\D/g,z=>+('0x'+z)-9))"). It might also save a few bytes using recursion

@Downgoat Thanks! I'd tried a .replace on the string before evaluating it, but that turned out longer.

Also remember you can make it an anonymous function, omitting h=

@CᴏɴᴏʀO'Bʀɪᴇɴ Thanks for the suggestions, but that won't work, because it needs to call itself.

Gah! Didn't see the recursion. I'm and idiot >_<

I realize this is an old answer. It seems to return an in correct answer for input 153. Expected result is 63. My original solution had the same issue.

CJam, 21 19 bytes
r{siGb_{(9%)}%_@#}g

Test it here.
Explanation
A very rare case of negative modulo results being helpful. :)
r       e# Read input.
{       e# While the condition on top of the stack is truthy...
  s     e#   Convert to string. This is a no-op in the first iteration, but necessary
        e#   on subsequent iterations.
  i     e#   Convert to integer.
  Gb    e#   Get base-16 digits.
  _{    e#   Copy and map over the copy...
    (   e#   Decrement.
    9%  e#   Modulo 9. If the digit was originally in the range 0 to 9, it will remain
        e#   unchanged because -1 % 9 == -1. If the digit was in 10 to 15, it will become
        e#   0 to 5, respectively.
    )   e#   Increment. Undoes the decrement for unchanged digits and fixes the letter
        e#   digits because A corresponds to 1, not 0.
  }%
  _     e#   Duplicate result.
  @#    e#   Pull up original digits and try to find them in the array. This will be zero,
        e#   i.e. falsy, if they are equal and -1, i.e. truthy, if they are not.
}g

Looks like another might be failing for 153? It seems odd that 3 out of the top 4 answers would have the same issue? http://cjam.aditsu.net/#code=r%7BsiGb_%7B(9%25)%7D%25_%40%23%7Dg&input=153

Ruby, 35 + 1 = 36
With command-line flag p, run
$_='%x'%$_
redo if$_.tr!'a-f','1-6'

Explanation:
The -p flag creates a loop, storing the input and eventual output in the variable $_. '%x' does the hex conversion, and tr! does the digit substitution and returns a falsey value if there wasn't anything to change. redo starts over with the new $_.

MATL, 23 25 bytes
Disclaimer
While writing this answer I noticed a bug in MATL's dec2base function, corrected it, and released a new version with the correction (as well as a couple other accumulated, unrelated changes).
Since I am using a version which is later than this challenge, according to consensus on Meta this answer is not eligible for winning.
Code
i`0:15YAt9X\t10ZQbb=~a]

Example
>> matl i`0:15YAt9X\t10ZQbb=~a]
> 234589
958

Explanation
i             % input number
`             % do...while
  0:15YA      % convert number to representation with base defined by symbols 0,...,15
  t9X\        % duplicate vector. Modulus 9 with 0 replaced by 9
  t10ZQ       % duplicate vector and convert to number using base 10
  bb=~a       % are second- and third-top stack elements different? (If so, next iteration)
]             % end

You could write an answer in the old version of the language!

@ThomasKwa The problem is that in the old version the compiler has a bug. I corrected it in the new version, which tangentially includes some (unrelated) new features

Julia, 78 74 bytes
f(x)=(h=hex(x);isdigit(h)?h:f(parse(replace(h,r"[a-z]",c->Int(c[1])-96))))

This is a recursive function that accepts an integer and returns a string.
Ungolfed:
function f(x::Integer)
    # Get the hexadecimal representation of x as a string
    h = hex(x)

    # Check whether all characters are digits
    if isdigit(h)
        # Return the hexadecimal representation of the input
        h
    else
        # Replace each letter with its position in the alphabet,
        # parse as an integer, and call f on the result
        f(parse(replace(h, r"[a-z]", c -> Int(c[1]) - 96)))
    end
end

Dyalog APL, 37 36 33 bytes
{∧/9≥X←16⊥⍣¯1⊢⍵:10⊥X⋄∇10(⊣⊥|+≤)X}

Thanks to Adám and ngn for suggestions. I'm keeping 16⊥⍣¯1⊢⍵ instead of ⍵⊤⍨⍴⍨16 - it's an extra byte, but allows us to operate on numbers of arbitrary size rather than 64-bit.

-2 by choosing the right inequality functions: {∧/9≥X←16⊥⍣¯1⊢⍵:10⊥X⋄∇10⊥10|X+9<X}

or even shorter: 10⊥10|X+10≤X -> 10(⊣⊥|+≤)X (technically not equivalent, but works for hex digits)

16⊥⍣¯1⊢⍵ -> ⍵⊤⍨⍴⍨16

Python, 118 105 bytes
def f(n):h=hex(n)[2:];return h if h.isdigit()else f(int(''.join(map(lambda x:chr((ord(x)-47)%48+47),h))))

PHP, 140 126 122 114 112 87 or 84 bytes (including -r)
Not entirely sure about how the rules around this as this is my first codegolf attempt, but the code can be run with php -r without needing <? and ?>
Code
$b=readline();while($c!=$b)$b=preg_replace('/\D/e','ord($0)-96',$c=dechex($b));echo$c

Formatted
$b=readline();
while($c!=$b){
  $b=preg_replace('/\D/e','ord($0)-96',$c=dechex($b));
}
echo "$b\n";

Alternate Code (using argv instead of stdin)
for($b=$argv[1];$c!=$b;)$b=preg_replace('/\D/e','ord($0)-96',$c=dechex($b));echo$b

Formatted
for($b=$argv[1];$c!=$b;) {
  $b=preg_replace('/\D/e','ord($0)-96',$c=dechex($b));
}
echo $b;

Notes
Edit 1: I cut out a call to intval() to save 14 characters as PHP will happily treat numerical strings as numbers.
Edit 2: I removed \n from the output that I forgot to remove after testing, and removed quote marks from the final echo to save a total of 4 characters.
Edit 3: Removed the last call to intval()
Edit 4: Saved 2 bytes by removing quote marks from the regex line
Edit 5: Changed [a-f] to \D to save 3 characters, removed strval call from preg_replace for 8 more; added version that uses argv[] instead of STDIN, moved the loop terminator into the while statement(oops!) saving  11 more characters, and moved the dechex call into the subject part of preg_replace for another 3, making a total of 25; also added a non-stdin version as an alternate version that uses 3 less characters. Thanks for the help, @Blackhole

Welcome on Code Golf! Since files without opening tags are valid PHP files, we always count the tags in PHP (or alternatively, we count the two bytes for the -r option). But a leading ; is always shorter than a leading ?>, so don't forget it. By the way, here is a shorter code: for($a=$argv[1];$b!=$a;)$a=preg_replace('#\D#e','ord($0)-96',$b=dechex($a));echo$b; (-29 bytes).

Input 153 should give 63, not 99. But -r is free. (see https://codegolf.meta.stackexchange.com/a/2428/55735)

R, 106 103 102 bytes
-3 bytes by using if instead of while
-1 byte thanks to Giuseppe using as.double instead of as.integer
a=function(y){x=as.hexmode(as.double(y))
if(grepl("[a-f]",x)){x=chartr("a-f","1-6",x);return(a(x))};x}

Try it online!
Just add a(your_integer_here) to the TIO to see the result.
> a(234589)
[1] "958"
> a(435234)
[1] "1617"
> a(99999)
[1] "4908"

I used recursion to reapply the function to each successive iteration, on the condition that it doesn't find any of the letters 'abcdef' within the string, when this condition is False, it outputs the result as a string. The best part was my discovery of the chartr function, which allows me to swap elements with corresponding elements in a string. This string comes from the function coercing the hexadecimal into a string format.
Edit: I tried to use sprint("%x",y) instead of as.hexmode(as.double(y)), but I am still required to use as.double somewhere in the code, which was 2 1 byte longer.

as.double is shorter than as.integer

There are some more golfs to be done but I am on mobile at the moment. Feel free to join our R golfing chat and don't forget to check out (and contribute to) tips for golfing in R!

C# (Visual C# Interactive Compiler), 92 bytes
n=>{var s=$"{n:x}";for(;(s=$"{s.Aggregate(0,(a,c)=>10*a+c%48):x}").Any(c=>c>57););return s;}

Try it online!
Less golfed code:
// anonymous function with
// input integer n
// output is a string
n=>{
  // 1) Convert the input to hexadecimal
  var s=$"{n:x}";
  for(;
    (s=$"{
      // 2) replace letters with their index in the alphabet
      s.Aggregate(0,(a,c)=>10*a+c%48)
      // 3) Convert the result back to hexadecimal
      :x}"
    // 4) If the result contains any letters, go to step 2
    ).Any(c=>c>57););
  // If not, output the result
  return s;
}

Following the algo in the end of question post, 153 has to result in 63 and not 99 as seems to me your function some time ago returned

@RosLuP - Got it to work w/ that 153, although now my solution is much longer :) I will work on getting it smaller, but for now at least it is handling that case correctly.

05AB1E, 12 bytes
h[Au₂L‡hÐþQ#

Try it online or verify all test cases.
Explanation:
h              # Convert the (implicit) integer-input to a hexadecimal string
               #  i.e. 234589 → "3945D"
 [             # Start an infinite loop:
  Au           #  Push the uppercase alphabet "ABC...XYZ"
    ₂L         #  Push a list in the range [1,26]
      ‡        #  Transliterate: replace all letters with the integers at the same index
               #   i.e. "3945D" → "39454"
               #   i.e. "239B" → "2392"
       h       #  Convert the integer to a hexadecimal string again
               #   i.e. "39454" → "9A1E"
               #   i.e. "2392" → "958"
        Ð      #  Triplicate it
         þ     #  Leave only the digits of the last copy
               #   i.e. "9A1E" → "91"
               #   i.e. "958" → "958"
          Q    #  Check if these digits and the hexadecimal string are equal
               #   i.e. "9A1E" and "91" → 0 (falsey)
               #   i.e. "958" and "958" → 1 (truthy)
           #   #  And if they are: stop the infinite loop
               # (and output the remaining copy from the triplicate implicitly as result)

ÐþQ could alternatively be D.ï (D: Duplicate; .ï: is_int?) for the same byte-count.

@MagicOctopusUrn [hÐþQ#Au₂L‡ doesn't always work unfortunately. The challenge states to convert to hex once first, and then in every iteration. If I paste your code in my test suite, the first three test cases are correct, but the last two fail.

Mathematica, 107 bytes
(b=FromDigits)@NestWhile[b[#/.Thread[10~Range~15->Range@6]]~a~16&,#~(a=IntegerDigits)~16,MemberQ[a_/;a>9]]&

Can't think of any more ways to golf this...

Java, 201 bytes
String f(int a){String s=Long.toString(a,16);while(s.matches(".*[a-z].*")){char[]b=s.toCharArray();for(int i=0;i96)b[i]-=48;s=Long.toString(new Long("".valueOf(b)),16);}return s;}

Mathematica, 80 bytes
i=IntegerDigits;f=FromDigits;f[#~i~16//.l_/;Max@l>9:>f[If[#>9,#-9,#]&/@l]~i~16]&

This uses a neat trick for while-loops I learned from alephalpha. The //. is "apply this substitution rule as often as possible". Then we use a pattern, l_/;Max@l>9 which only matches if the hexadecimal digit list still contains digits greater than 9.

Japt, 45 40 bytes
Based on my JS answer:
I=_nG -9}H=_=ZsG)f/\D/ ?H$($ÂZr"\\D"I):Z

Pretty pathetic for a golfing language, huh? There seems to be a lot of folks realizing during this challenge that their interpreters have bugs, and I am now included among them. This should be able to be done in 30 bytes or less, but a bug makes this impossible.
This creates a function H that can be called like so:
I=_nG -9}H=_=ZsG)f/\D/ ?H$($ÂZr"\\D"I):Z}
$H(234589)$

Alternatively, here is a full program, taking input from STDIN:
I=_nG -9}H=_=ZsG)f/\D/ ?H$($ÂZr"\\D"I):Z}H$(U

Try it online!

GNU Sed (with eval extension), 44
:
y/ABCDEF/123456/
s/^/printf %X /e
/[A-F]/b

I wish sed would allow y/A-F/1-6/.  But it doesn't.

Python 3, 101 89 bytes
Overall, this is quite similar to Boomerang's solution, but it takes a few different approaches to various aspects.
def d(n):n=hex(int(n))[2:];return n.isdigit()and n or d(str([ord(c)%12for c in n])[1::3])

This is the expanded version of my original code:
def d(n):
    n = int(n)                        # Interpret input as a decimal integer.
    n = hex(n)[2:]                    # Convert it to hex, stripping the '0x'.
    if n.isdigit():                   # If every character is a digit...
        return n                      # ...we're done.
    else:                             # Otherwise...
        n = ''.join(c if c < ':' else # ...don't change digits (':' is after
                    chr(ord(c - 48))  # '9'), but do change letters ('1' is 48
                    for c in n)       # characters before 'a').
        return d(n)                   # Then follow the process again.

11 bytes were shed thanks to @pacholik (replacing the innards of the join with a single operation that worked for both digits and letters). Another byte was trimmed by replacing the join with a string-slicing trick that hit me in a lightbulb moment (but which already exists in the Python golfing tips, albeit under a heading that specifies Python 2).

The join can be shortened to str(ord(c)%12)for c in n.

APL(NARS) 104 chars, 208 bytes
f←{k←10⊥{⍵≤9:⍵⋄1+10∣⍵}¨q←{(16⍴⍨⌊1+16⍟⍵)⊤⍵}⍵⋄9≥⌈/q:k,0⋄k,1}
t←{⍵≤0:0⋄0=2⊃v←f⍵:↑f↑v⋄{k←f⍵⋄0=2⊃k:↑k⋄∇↑k}⍵}

test:
  t 153
63
  t 0
0
  t 234589
958
  t 435234
1617
  t ¯123
0

I don't know if it is ok... Possible it is not enough for the standard quality answer...

Japt, 21 bytes
ìG
®+zA
eV ?U:ßVmuA ì

Try it online!
A significant improvement over the existing Japt answer. It doesn't handle the 153 -> 63 case proposed in a comment, but none of the other answers seem to either so I'll leave it unless the OP clarifies.
Output as a list of decimal digits, could be changed to outputting a decimal number for 1 byte
Explanation:
ìG               #Get a list of base-16 digits, each as a base-10 number
                    e.g. 234589 -> [3,9,4,5,13]

®+zA             #Increment the numbers greater than 10
                    e.g. [3,9,4,5,13] -> [3,9,4,5,14]

eV ?             #If the second step didn't change any digit:
    U            # Output the digits from step 1
     :           #Otherwise
      ß          # Repeat the program with new input:
       V         #  The result of step 2
        muA      #  With each digit modulo 10
            ì    #  Treated as a base-10 number

Seriously, 42 bytes
1╤╝4ª╗,$1WX╛@¿╜@¡;`╜@¿;)╛;(\(+%$`Mεj;)=YWX

Hex Dump:
31d1bc34a6bb2c24315758be40a8bd40ad3b60bd40
a83b29be3b285c282b2524604dee6a3b293d595758

Try it online
There has to be a shorter way than this, but this is what I got... (This is where I find myself wishing W actually popped, since it's shorter to put a ; right before the last one when you DON'T want it to than to put an X after EACH W. Here, having W pop instead of peek would save three bytes.)

PHP, 71 bytes
while($n++<2|$b-$a=&$argn)$a=strtr($b=dechex($a),abcdef,123456);echo$a;

Run as pipe with -nR or try it online.
Yields a warning for some inputs in PHP 7.1 and later; replace - with != to fix.
Yields another warning in PHP 7.2; put abcdef in quotes to fix.

Japt, 18 bytes
Æ=ìG ®%9ª9Ãì)sGÃæÑ

Try it

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/