text:
Generate the Abacaba sequence
This challenge is about printing the abacaba sequence of a specific depth.
Here is a diagram of the first 5 sequences (a(N) is the abacaba sequence of depth N, upper/lowercase is just to show the pattern, this is not needed in the output of your program):
a(0) = A
a(1) = aBa
a(2) = abaCaba
a(3) = abacabaDabacaba
a(4) = abacabadabacabaEabacabadabacaba
...
a(25) = abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabajabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaia...

As you can probably tell, the n'th abacaba sequence is the last one with the n'th letter and itself again added to it. (a(n) = a(n - 1) + letter(n) + a(n - 1))
Your task is to make a program or function that takes an integer and prints the abacaba sequence of that depth. The output has to be correct at least for values up to and including 15.

Wouldn't the sequence be undefined after ₂₅?

@Legion OP's mentioned that "The output has to be correct at least for values up to and including 15", so it doesn't matter.

@nicael I know, I was just wondering how (∞) would be defined.

Huh. I had been contemplating posting this challenge.

Also known as the ruler sequence (but with letters instead of numbers), for something more easily Google-able.

Does the input have to be in decimal?

Why is a(0)="a"? Why not ""?

@CatsAreFluffy Because this is how the famous sequence is defined.

For what it's worth, any valid solution to this problem is also the solution to the Towers of Hanoi puzzle for N disks.

Can we use 1-based indexing instead of 0-based indexing?

These are also called sesquipowers or Zimin words.

Pyth, 11 bytes
u++GHG<GhQk

Simple reduction.

@Loovjo Oh. Makes no sense, 0 should be the empty sequence IMO, but I'll conform to the question...

Yeah, simple. goes and bangs head on wall

@JAtkin Open up Pyth's rev-doc.txt next to this answer, and it should readily show itself to be simple.

Hehehe, not what I meant (I don't know pyth, so....)

Haskell, 39 37 bytes
a 0="a"
a n=a(n-1)++['a'..]!!n:a(n-1)

Usage example: a 3 -> "abacabadabacaba".
Edit: @Angs found two bytes to save. Thanks!

Wouldn't a n=a(n-1)++[97+n]++a(n-1) work? Can't test right now.

@Seeq: no, [97+n] is a list of Integer and a(n-1) is a list of Char (aka String). You cannot concatenate lists with different types. toEnum makes a Char out of the Integer.

Ah, I always thought Char was just a specialized integer in Haskell.

['a'..]!!n is 2 bytes shorter than toEnum(97+n)

@Angs: Good catch! Thanks!

Python, 44 bytes
f=lambda n:"a"[n:]or f(n-1)+chr(97+n)+f(n-1)

Looks suspiciously might-be-golfable.

Pyth, 14 13 bytes
Thanks to Jakube for saving a byte!
VhQ=+k+@GNk;k

A solution with 14 bytes: VhQ=ks[k@GNk;k.
Explanation:
VhQ=+k+@GNk;k

               # Implicit: k = empty string
VhQ            # For N in range input + 1
   =           # Assign k
      +@GNk    # Position N at alphabet + k
    +k         # k + above
           ;   # End loop
            k  # Print k

Try it here!

Shouldn't "N in range" be on the V line? hQ is just eval(input) + 1

@Loovjo Yeah, that's better and less confusing :)

You can shorten =k to =. Pyth will automatically assign the result to k, since k is the first variable in the expression +k+@GNk.

@Jakube Thank you very much! :)

I have a different answer for this challenge. It won't beat this solution, but it does illustrate a technique for giving the first n characters of the sequence: Vt^2Q=+k@Gx_.BhN`1)k (In this instance, it's set to give the first 2^Q-1 characters as the challenge requires, but you can see how to change that.)

Actually, this is shorter (for the same purpose as prev comment): sm@Gx_.Bd`1St^2Q

And here's an even better way to find the exponent of 2 (thanks to isaacg): sm@G/Phd2t^2Q. This one actually ties this answer.

Brainfuck, 157 bytes
,+>-[>++<-----]>----->>+<<<<[->>[[->>[>>>]<+<+<[<<<]>>[>>>]<]>>[>>>]<[-<<[<<<]>>[>>>]<+>>[>>>]<]+>+<<<[<<<]>>[>>>]+[>>>]<]<<<+>>[<-<<]<]>>>>[>>>]<<<<<<[<<.<]

Input is given in binary.
The basic idea is to repeatedly duplicate the current sequence (starting with "a") and to increment the last element after each iteration:

a → aa → ab
ab → abab → abac
abac → abacabac → abacabac
...

When all of this has been done the specified amount of times, the result gets printed excluding the last element.
In-depth explanation
The memory is arranged in the following way:
.---------.-.-----.----.---.-----.----.---.---
|Countdown|0|Value|Copy|End|Value|Copy|End|...
'---------'-'-----'----'---'-----'----'---'---

            |--Element 1---|--Element 2---|

Countdown holds the number of copy cycles that are yet to be executed. The ABACABA sequence is stored in adjecent blocks, each made up of 3 cells. Value holds the character of the element (i.e. "A","B","C"...). The Copy flag indicates whether or not the corresponding element needs to be copied within the current copying cycle (0=copy, 1=don't). The End flag is set to 0 for the last element while it is being copied (it's 1 in all other cases).
Now to the actual (slightly ungolfed) program:
,                       read Countdown from input
+                       add 1 to avoid off-by-one error
>-[>++<-----]>-----     initialize value cell of first element to 97 ("a")
>>+                     set End flag of first element to 1
<<<<                    move to Countdown
[                       loop until Countdown hits 0 (main loop)
    -                   decrement Countdown
    >>                  move to Value cell of first element
    [                   copying loop
        [               duplication sub-loop
            -           decrement Value cell of the element to copy
            >>          move to End flag
            [>>>]       move to End flag of the last element
            <+<+        increment Copy and Value cell of last element (Copy cell is temporarily abused)
            <           move to End flag of second to last element
            [<<<]>>     move back to Copy cell of first element
            [>>>]<      move to Value cell of the first element where the Copy flag is 0
        ]
        >>[>>>]<        move to (abused) Copy flag of the last element
        [               "copy back" sub-loop
            -           decrement Copy flag
            <<          move to End flag of second to last element
            [<<<]>>     move back to Copy cell of first element
            [>>>]<      move to Value cell of the first element where the Copy flag is 0
            +           increment Value cell
            >>[>>>]<    move back to Copy flag of the last element
        ]
        +>+             set Copy and End flag to 1
        <<<             move to End flag of second to last element
        [<<<]>>         move back to Copy cell of first element
        [>>>]<          move to Value cell of the first element where the Copy flag is 0
        >+<             set Copy flag to 1
        >[>>>]<         move to Value cell of the next element to copy
    ]                   loop ends three cells behind the last "valid" Value cell
    <<<+                increment Value cell of last element
    >>                  move to End flag
    [<-<<]              reset all Copy flag
    <                   move to Countdown
]
>>>>                    move to End flag of first element
[>>>]<<<                move to End flag of last element
<<<                     skip the last element
[<<.<]                  output Value cells (in reverse order, but that doesn't matter)

Welcome to the site!  I'd be interested in a more detailed breakdown!

@SriotchilismO'Zaic Thanks for your reply :) I have now added a detailed explanation.

Retina, 37 32 bytes
$
aa
(T`_l`l`.$
)`1(a.*)
$1$1
z

The trailing linefeed is significant. Input is taken in unary.
Try it online!

It does not work.

@KennyLau yes, because Retina changed since I posted this answer. If you check out the release that was most recent when this was posted directly from GitHub, it will work with that.

Haskell, 36 bytes
tail.(iterate((:"a").succ=<<)"_a"!!)

Try it online!
This uses a different recursive method from most of the other answers. To get the next string in the sequence, we don't join two copies in the previous string with a new letter in between, but instead increment every letter and intersperse a's.
aba -> bcb -> abacaba

JavaScript (ES6), 43 42 bytes
a=n=>n?a(--n)+(n+11).toString(36)+a(n):"a"

A byte saved thanks to @Neil!
Yet another simple recursive solution...

(n+11).toString(36) saves you 1 byte, and works for up to a(25)!

@Neil Implemented. Thanks!

05AB1E, 12 bytes (non-competitive)
Code:
'aIGDN>.bsJl

I'll be damned. I fixed a lot of bugs thanks to this challenge haha.
Explanation:
'aIGDN>.bsJl

'a             # Push the character 'a'
  I            # User input
   G           # For N in range(1, input)
    D          # Duplicate the stack
     N         # Push N
      >        # Increment
       .b      # Convert to alphabetic character (1 = A, 2 = B, etc.)
         s     # Swap the last two elements
          J    # push ''.join(stack)
           l   # Convert to lowercase
               # Implicit: print the last item of the stack

Why is it non-competitive?

@Loovjo I fixed the bugs after the challenge was posted, therefore it's non-competitive :(

jq -r, 43 bytes
def f:.-1|[[97]][.+1]//f+[.+98]+f;f|implode

Try it online!

With the capitalization pattern from the example outputs, 58 bytes:
def f:[[65]][.]//([.-1|f[]%32+96,.+66]|.+.)[:-1];f|implode

Try it online!
def f:    ...       ;  define a filter named f
      [[65]][.]        base case, if the argument . is 0, return [65]
      //               otherwise
         .-1|f         call the filter recursively
         []%32+96      convert each codepoint to lower case
          ,.+66        append .+66 (. is now the filter argument -1)
         [ ... ]       collect all codepoints in an array
         |.+.          and repeat that array twice
         [:-1]         remove the last integer
f|implode              call the filter on the input and convert the result to a string

CJam (14 bytes)
'aqi{'b+1$++}/

Online demo

Ruby (1.9 and up), 38 bytes
?a is a golfier way to write "a" but looks weird when mixed with ternary ?:
a=->n{n<1??a:a[n-1]+(97+n).chr+a[n-1]}

R, 48 bytes
f=function(n)if(n)paste0(a<-f(n-1),letters[n],a)

Try it online!
Simple recursion.

Uh, what is paste0???

@Xi'an paste0 is equivalent to paste with sep="", so you avoid the spaces between letters that paste would add by default.

jq, 51 bytes
[range(.)+97|[.]|implode]|reduce.[]as$i("a";.+$i+.)

Try it online!
My life has improved significantly since I found reduce in this language.
-16 bytes from ovs.

Labyrinth, 31 bytes
_-)"(;;
(. ?  {_
@  +}989
   1_

Try it online!
I feel like this can be rearranged to be golfier, but a better layout eludes me. I also have a cleaner 1-indexed version which has a higher ratio of walls. This uses xnor's method of repeatedly incrementing the string and interspersing with as.

Perl, 33 bytes
map$\.=chr(97+$_).$\,0..pop;print

No real need for un-golfing. Builds the string up by iteratively appending the next character in sequence plus the reverse of the string so far, using the ASCII value of 'a' as its starting point. Uses $\ to save a few strokes, but that's about as tricky as it gets.
Works for a(0) through a(25) and even beyond. Although you get into extended ASCII after a(29), you'll run out of memory long before you run out of character codes:
a(25) is ~64MiB. a(29) is ~1GiB.
To store the result of a(255) (untested!), one would need 2^256 - 1 = 1.15x10^77 bytes, or roughly 1.15x10^65 1-terabyte drives.

We need those atom-shudder yottabyte drives, now!

MATL, 14 bytes
0i:"t@whh]97+c

This uses version 8.0.0 of the language/compiler, which is earlier than the challenge.
Example
>> matl
 > 0i:"t@whh]97+c
 >
> 3
abacabadabacaba

Explanation
The secuence is created first with numbers 0, 1, 2, ... These are converted to letters 'a', 'b', 'c' at the end.
0         % initiallize: a(0)
i:        % input "N" and create vector [1, 2, ... N]
"         % for each element of that vector
  t       % duplicate current sequence
  @       % push new value of the sequence
  whh     % build new sequence from two copies of old sequence and new value
]         % end for
97+c      % convert 0, 1, 2, ... to 'a', 'b', 'c'. Implicitly print

Edit
Try it online!

Python, 62 54 46 45 bytes
I would like to think that this code can still be golfed down somehow.
Edit: Bug fix thanks to Lynn. -1 byte thanks to squid.
a=lambda n:n and a(n-1)+chr(97+n)+a(n-1)or'a'

Try it online!

Output should be in all-lowercase. The uppercase in the question is just for clarity about the repetition.

Whoops. Thanks for the clarification.

Blargle. Thanks @user81655

This is invalid (it never terminates — try it). Even in the base case, the recursive part of the expression is evaluated.

Fixed. Thanks @Lynn!

I'm late, but 45 bytes with chained comparison

C#, 59 bytes
string a(int n){return n<1?"a":a(n-1)+(char)(97+n)+a(n-1);}

Just another C# solution...

Mathematica, 36 32 bytes
##<>#&~Fold~Alphabet[][[;;#+1]]&

Have you ever watched TWOW 11B?

There is no need for the "", and then you can use infix notation for Fold.

#1 causes null <>s, and #2 only works for binary functions.

Did you post this comment on the answer you intended? Because I have no idea what you mean. :)

*#1 causes StringJoin to join nulls, and #2 only works for binary or associative functions. (x~Fold~y~Fold~z=Fold[x,Fold[y,z]] instead of Fold[x,y,z])

Oh you mean "suggestion #1". No it doesn't cause Nulls. Why would it?

Oh, I thought you meant "", not "",. With that they both work. Implementing.

Java 7, 158 bytes
class B{public static void main(String[]a){a('a',Byte.valueOf(a[0]));}static void a(char a,int c){if(c>=0){a(a,c-1);System.out.print((char)(a+c));a(a,c-1);}}}

I like to lurk around PPCG and I would enjoy being able to vote/comment on other answers.
Input is given as program parameters. This follows the same format as many other answers here in that it's a straight forward recursive implementation. I would have commented on the other answer but I don't have the rep to comment yet. It's also slightly different in that the recursive call is done twice rather than building a string and passing it along.

Welcome to PPCG then! I hope you'll do some more than voting and commenting in the future (but don't feel like you have to). :)

Husk, 12 bytes
!¡S+oṠ:o→▲"a

Try it online!
Uses 1-based indexing, which I hope is OK.
Explanation
!             (                                          !!)
 ¡             iterate(                              )
  S                        <*>
   +                   (++)
    o                         (                     )
     Ṡ                         join$   .
      :                             (:)
       o                                    .
        →                               succ
         ▲                                   maximum
          "a                                          "a"

              (iterate((++)<*>(join$(:).succ.maximum))"a"!!)

Vim, 35 bytes
:h<_
jjYZZpqqv|yPyl/<c-r>"
xq{Dddl@-@qD

Try it online!
Explanation
The buffer starts with a single line containing the input integer.
:h<_
jjYZZp

Yank the lowercase alphabet from the help file. Paste it on a new line below the integer, leaving the cursor on the first character of the second line.
qq

Start recording macro q. This will be our "loop."
v|y

Using visual mode, select everything from the current character to the beginning of the line, inclusive, and yank it. This leaves the cursor on the first character of the line.
P

Paste the yanked text to the left of the cursor. The cursor is now on the last of the pasted characters.
yl

Yank that character.
/<c-r>"
x

Find the next occurrence of the just-yanked character. Delete it.
q

Stop recording the macro. Conveniently, this first time through the macro has left the alphabet unchanged. The only effect is that the cursor has moved from the a to the b.
{Dddl

Go to the beginning of the buffer. Delete the contents of the first line (the input number). Then delete the (now-empty) first line. Move the cursor one character to the right so as to start on b.
@-@q

Execute the macro N times, where N is the number we just deleted.
D

Delete the unused remainder of the alphabet.

Normally, the @-@q idiom is fraught with peril if the number has a chance of being zero, because 0 is not a valid count in Vim; instead, it is treated as a separate command that move the cursor to the beginning of the line. However, in this particular case, an input of 0 is no problem at all:
@-

Move the cursor to the beginning of the line.
@q

Execute the macro once. Recall that executing the macro with the cursor on the a leaves the alphabet unchanged and the cursor on the b.
D

Delete everything to the end of the line--which leaves only the a, exactly the output we want.

Knight (v2.0-alpha), 37 bytes
;=q+96=n+1P;=x"";W=n-nT=x++xA-q n xOx

Try it online!
Expanded
; = q (+ 96 (= n (+ 1 PROMPT)))
; = x ""
; WHILE (= n (- n TRUE))
    = x (+ (+ x (ASCII (- q n))) x)
: OUTPUT x

Thunno 2 J, 9 bytes
Oėıf2c;⁺Ä

Attempt This Online!
Port of emanresu A's Vyxal answer.
Explanation
Oėıf2c;⁺Ä  # Implicit input
O          # Push 2 ** input
 ė         # Push [1..that)
  ı   ;    # Map:
   f       #  Prime factors
    2c     #  Count 2s
       ⁺Ä  # Letter of alphabet
           # Implicit output

Vyxal, 61 bitsv2, 7.625 bytes
¤$(nøAȮW∑

Try it Online!
Uses 1-indexing.
Explained
Generated using Luminespire
¤$(nøAȮW∑
¤$         # Push an empty string under the input
  (        # For each n in the range [1, input]:
   nøA     #   Get the nth letter of the alphabet
      Ȯ    #   Push a copy of the item under the top of the stack. This leaves the stack as [already generated, new letter, already generated]
       W∑  #   Wrap and sum the stack

K5, 18 bytes
"A"{x,y,x}/`c$66+!

Repeatedly apply a function to a carried value ("A") and each element of a sequence. The sequence is the alphabetic characters from B up to some number N (`c$66+!). The function joins the left argument on either side of the right argument ({x,y,x}).
In action:
 ("A"{x,y,x}/`c$66+!)'!6
("A"
 "ABA"
 "ABACABA"
 "ABACABADABACABA"
 "ABACABADABACABAEABACABADABACABA"
 "ABACABADABACABAEABACABADABACABAFABACABADABACABAEABACABADABACABA")

I think the sequence should be lowercase, but that costs no bytes.

Japt, 20 17 bytes
97oU+98 r@X+Yd +X

Test it online!
How it works
         // Implicit: U = input integer
65oU+66  // Generate a range from 65 to U+66.
r@       // Reduce each item Y and previous value X in this range with this function:
X+Yd     // return X, plus the character with char code Y,
+X       // plus X.

         // Implicit: output last expression

Non-competing version, 14 bytes
97ôU r@X+Yd +X

The ô function is like o, but creates the range [X..X+Y] instead of [X..Y). Test it online!
I much prefer changing the 97 to 94, in which case the output for 5 looks like so:
^_^`^_^a^_^`^_^b^_^`^_^a^_^`^_^c^_^`^_^a^_^`^_^b^_^`^_^a^_^`^_^

JavaScript, 65 571 bytes
n=>eval('s="a";for(i=0;i<n;i++)s+=(i+11).toString(36)+s')

Demo:

function a(n){
  return eval('s="a";for(i=0;i<n;i++)s+=(i+11).toString(36)+s')
}
alert(a(3))

 1 - thanks Neil for saving 8 bytes

(i+11).toString(36) saves you 6 bytes.

@Neil Haha, that's a clever hack

Oh, and if you move the assignment s="a"; to before the for then it becomes the default return value and you can drop the trailing ;s for another 2 byte saving.

@Neil Nice, didn't know about that.

I think you can save a byte by incrementing i inline and dropping the increment in the for loop. So... for(i=0;i<n;)s+=(i+++11)...

...and also, why use eval?

That looks slightly syntactically incorrect. How about ...(++i+10)...?

Mathematica, 46 bytes
If[#<1,"a",(a=#0[#-1])<>Alphabet[][[#+1]]<>a]&

Simple recursive function. Another solution:
a@0="a";a@n_:=(b=a[n-1])<>Alphabet[][[n+1]]<>b

Java, 219 bytes
My first code golf attempt. Probably can be golf'd further, but I'm hungry and going out to lunch.
public class a{public static void main(String[]a){String b=j("a",Integer.parseInt(a[0]),1);System.out.println(b);}public static String j(String c,int d,int e){if(d>=e){c+=(char)(97+e)+c;int f=e+1;c=j(c,d,f);}return c;}}

Ungolfed:
public class a {
    public static void main(String[] a) {
        String string = addLetter("a", Integer.parseInt(a[0]), 1);
        System.out.println(string);
    }

    public static String addLetter(String string, int count, int counter) {
        if (count >= counter) {
            string += (char) (97 + counter) + string;
            int f = counter + 1;
            string = addLetter(string, count, f);
        }
        return string;
    }
}

Pretty straightforward brute force recursive algorithm, uses char manipulation.

You can omit the public keyword from a and addLetter/j.

Powershell, 53,46,44,41 Bytes
1..$args[0]|%{}{$d+=[char]($_+96)+$d}{$d}

Pasting into console will generate erronous output on the second run since $d is not re-initialized.
Save 2 bytes by using +=
Save 3 bytes thanks to @TimmyD

@TimmyD Actually gets it down to 41 since I won't need the (,).

No, that was my fault, I actually forgot to update it even though I said I did.

the script does not wirk with 0 and does not generate a uppercase letter

Gaia, 14 bytes
₵aØ@⟪¤ṇ3ṁ¤+ṫ⟫ₓ

Try it online!
₵a		| Push lowercase alphabet
  Ø		| push lowercase string
   @         ₓ	| push the input and do everything between ⟪⟫ that many times
    ⟪¤		| swap
      ṇ		| take the last (first) character
       3ṁ	| push the 3rd item on the stack
         ¤+	| swap and concatenate
           ṫ⟫	| and palindromize

Japt, 8 bytes
;gCåÈ+iY

Try it
;gCåÈ+iY     :Implicit input of integer
 g           :Index into
; C          :  Lowercase alphabet
   å         :  Cumulatively reduce, with an initial value of an empty string
    +        :    Append a copy of the current value
     i       :    Prepended with
      Y      :    The current letter

PowerShell, 54 bytes
param($n)for(;$n+1){$d+=[char]($i+++97-32*!$n--)+$d}$d

Try it online!

APL(NARS), 24 chars, 48 bytes
{⍵<0:⍬⋄k,⎕A[⍵+1],k←∇⍵-1}

test:
  f←{⍵<0:⍬⋄k,⎕A[⍵+1],k←∇⍵-1}
  f 0
A
  f 1
ABA
  f 2
ABACABA
  f 3
ABACABADABACABA
  f 4
ABACABADABACABAEABACABADABACABA

Doesn’t APL use it’s own code page with every character one byte, making this 24 bytes?

@Loovjo for what I know  Nars Apl has character set 2 bytes for character

APL (Dyalog Classic), 20 19 17 bytes
⎕a[¯1↓⊥¨⍨,⍳2,⎕⍴2]

Try it online!
yet another apl answer

PHP -r, 43 bytes
register_argc_argv must be enabled for this to work.
for($a=$b=a;$argv[1]--;$a.=++$b.$a);echo$a;

Try it online!
PHP, 51 bytes
An anonymous function that prints the output directly.
function($n){for($a=$b=a;$n--;$a.=++$b.$a);echo$a;}

Try it online!

Befunge-93, 41 bytes
1-011v $<
v::+&_:#^!_:1+v
>:0\:^,+"`"$%:<

Try it online!
Probably some room for improvement here.
Explanation
The sequence is generated using its recursive definition. First, we initialize the stack with the 4 values (1, input+2), (0, -1). Each pair (a, b) on the stack is an "instruction" used in generating the sequence, which, when executed, gets popped and does the following:

if a == 0:

if b == -1, terminate
if b == 0, do nothing
if b != -1 and b != 0, print b+96 as an ASCII character

if a != 0, push (b-1, b-1), (0, b-1), (b-1, b-1)

The top two items on the stack are continuously run as a sequence-building instruction until the program terminates.
Worth noting that &+ is used the first time around to get the input, as well as every subsequent time as a decrement (because when there is no more input, & returns -1)

Lua, 69 bytes
f=function(n)return n<1 and"a"or f(n-1)..string.char(97+n)..f(n-1)end

Try it online!

C++ (gcc), 58 53 bytes
string f(int n){return n--?f(n)+char(98+n)+f(n):"a";}

- 5 bytes saved by ceilingcat
Try it online!

05AB1E (legacy), 9 bytes
AćsI£vDyý

Try it online!
Also runs with the new 05AB1E version.
code:
A       push the lowercase alphabet
ć       extract first character of that ["bcdefg....", "a"]
s       swap both strings ["a", "bcdefg...."]
I£      drop all letters of the alphabet after the index defined by input
v       for each character
  D     duplicate last stack entry
  yý    join by current letter
        implicitly close for-loop and print top of stack

k4, 23 bytes
{.Q.a x{x,(1+|/x),x}/0}

      x{           }/0  / do {func} x times, passing output of last iteration as input (first input is 0)
          (1+|\x)       / 1 + max x
        x,       ,x     / join x either side
 .Q.a                   / index into alphabet

executed with inputs [0,4) we get:
  {.Q.a x{x,(1+|/x),x}/0}'[0 1 2 3]
("a";"aba";"abacaba";"abacabadabacaba")

Vyxal s, 11 bytes
Eɽƛǐ2O;97+C

Try it Online!
Eɽ          # 0...2**n
  ƛ   ;     # Mapped to...
   ǐ2O      # Count of 2 in prime factorisation
       97+C # Add 97 and get charcodes

Pip, 14 bytes
a?z@aWRREa-1'a

Takes the integer as a command-line argument. Try it here! Or, here's a 15-byte equivalent in Pip Classic: Try it online!
Explanation
A recursive full program.
a?              ; Is the argument truthy (non-zero)?
                ; If so:
  z@a           ;  Get the letter of the lowercase alphabet at index a
     WR         ;  and wrap it in two copies of
       RE       ;  the result of a recursive call
         a-1    ;  with argument a-1
                ; Otherwise:
            'a  ;  Return the letter a

Python 3.8 (pre-release), 43 bytes
a=lambda n:'a'[n:]or(b:=a(n-1))+chr(97+n)+b

Try it online!

Arturo, 48 bytes
f:$->x[(0=x)?->"a"->++++f x-1to :char x+97f x-1]

Try it!
f:$->x[               ; a function named f taking an argument x
    (0=x)?            ; is x zero?
    ->"a"             ; then return "a"
    ->                ; otherwise,
        ++++          ; append three things together
        f x-1         ; f(x-1)
        to :char x+97 ; x converted to character
        f x-1         ; f(x-1)
]                     ; end function

Rockstar, 80 bytes
1-indexed
listen to N
X's 0
O's ""
while N-X
cast X+97 in C
let O be+C+O
let X be+1

say O

Try it (Code will need to be pasted in)

Matlab, 54 bytes
Just a straight forward recursive implementation.
function s=f(n);s='';if n>-1;k=f(n-1);s=[k,n+97,k];end

I first thought I could do better by using anonymous functions, but it turned out to be way longer, but I thougt I still share it:
i=@(b,c)c{2-b}();
a=@(n,f)i(n<0,{@()'',@()[f(n-1,f)),n+97,f(n-1,f)]});
ba=@(n)a(n,a);

J, 30 28 bytes (Try it online!)
I just found out that a(0) = "a", which chopped of 2 bytes.
u:97+(0:`($:@<:,],$:@<:)@.*)

Usage:
   u:97+(0:`($:@<:,],$:@<:)@.*) 2
abacaba

How it works:
u:97+(0:`($:@<:,],$:@<:)@.*) n NB. pseudocode:
                               NB. input as n
                               NB. function as generate_tree
u:                             NB.   convert_to_ASCII(
  97+                          NB.     add_to_all(97,
     (xx`yyyyyyyyyyyyyyy@.z)   NB.       if z then y or x:
                          *    NB.         z: n>0?
      0:                       NB.         x: 0
         ($:@<:,],$:@<:)       NB.         y:
          ppppp,q,rrrrr        NB.           concat(p,q,r):
          $:@<:                NB.             p:
          $:@                  NB.               generate_tree(
             <:                NB.                 n-1)
                ]              NB.             q: n
                  $:@<:        NB.             r: generate_tree(n-1)

Pyke, 11 bytes (noncompeting)
G@QVk?tQG@:

Try it here!
G@          - s = alphabet[input]
  QV        - repeat input times:
     ?tQ    -   input -= 1
        G@  -  alphabet[^]
    k     : - s = s.replace("", ^)

Canvas, 8 bytes
ø⁸╵ｚｍ｛＋│

Try it here!
7 bytes taking the index starting with 1, or hacky 6 bytes by taking input "with a trailing newline" (which together can sum up to 5 bytes)

Perl 6, 35 bytes
{('a',{$_~chr(++$+97)~$_}...*)[$_]}

Try it online!

Jelly, 9 bytes
‘R;ṭ¥/ịØa

Try it online!
It would be 8 were it not for the requirement for the sequence to start with zero = a.

Mumps (InterSystems), 46 bytes
S Q="",A=65 R N F I=0:1:N{S Q=Q_$C(A+I)_Q} W Q

InterSystems' version of Mumps (some say M, InterSystems likes to call it "Cache Object Script") allows delineating loops with braces which helps keep things on a single line; GT.M would be a few characters longer.

JavaScript, 169 bytes
x=function(n){var r="";for(var i=1;i<=Math.pow(2,n)-1;i++){for(var j=i;j>=0;j--){if(!(i%Math.pow(2,j))){r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j];break;}}}return r;}

Try it online!
Live demo:

x=function(n){var r="";for(var i=1;i<=Math.pow(2,n)-1;i++){for(var j=i;j>=0;j--){if(!(i%Math.pow(2,j))){r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j];break;}}}return r;}

console.log(x(prompt("Input depth of ABACABA Pattern")))

Explanation:

x = function(n){ // created function, and yes, I omitted var
  var r = ""; // declaring variable to be returned
  for (var i = 1; i <= Math.pow(2, n) - 1; i++){ // this loop creates each letter in the pattern; "Math.pow(2, n) - 1" is the length of the pattern at depth n
    for (var j = i; j >= 0; j--){ // this loop finds the greatest power of 2 that i is divisible by, since that can be used to find the correct character for that index
      if (! (i % Math.pow(2, j) ) ){ // the modulo part checks the divisibility of 2^j; the "!" replaces "=== 0"
        r += "ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j]; // appending character to r
        break; // exits loop once greatest power of 2 i is divisible by is found
      }
    }
  }
  return r;
}

The x= can be omitted if you do not refer to it anywhere else, and also I think "ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j] can be (j+10).toString(36) because (1) .slice(0,n) is not necessary here, and (2) (j+10).toString(36) returns j+10 in base 36, which should be equivalent to your code.

Clojure, 63 bytes
#(loop[r""i 0](if(= i %)r(recur(str r(char(+ i 97))r)(inc i))))

Stax, 7 bytes
ö▬⌐ç╗à╢

Run and debug it
This uses 1-based indexing.
0-based indexing costs another byte

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

authors: Xi'an ні війні


text:
Alignment on Triangular Grids
Hexagonal grids have been become a fairly popular twist for challenges about 2-dimensional data recently. However, it seems that the equally interesting triangular grids have been largely neglected so far. I'd like to rectify that with a rather simple challenge.
First, how do we represent a triangular grid? Consider the following example (ignore the right diagram for now):

The cells neatly fall onto a regular grid (the difference to a regular grid being only which cells are considered adjacent):
1234567
89abcde
fghijkl
mnopqrs

Now, as the right diagram shows, a triangular grid has three main axes: a horizontal and two diagonal ones.
Highlighting these in the ASCII grid:
AVAVAVA
VAabcAV
fVAiAVl
mnVAVrs

The Challenge
You're given a rectangular string representing a triangular grid (where the top left corner is an upwards-pointing triangle). Most of the cells with be ., but exactly two cells will be #, e.g.:
....#
.#...
.....

Determine whether the two # are aligned along any of the three axes of the grid (i.e. whether they lie on a single row in any of the three directions highlighted above). For this example, the answer is "no".
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.
Input may be a single string delimited by linefeeds or some other convenient character, or a list of strings. You may use any two (consistent) printable ASCII characters in place of . and #.
Output should be a truthy value if the highlighted cells are aligned and a falsy value otherwise.
Standard code-golf rules apply.
Test Cases
Truthy grids:
.#..#.

#
#

...........
...#.......
...........
...........
...........
.......#...
...........

...........
.......#...
...........
...........
...........
...#.......
...........

.#.........
...........
...........
...........
...........
.......#...
...........

...........
...#.......
...........
...........
...........
...........
.......#...

.........#.
...........
...........
...........
...........
...#.......
...........

...........
.......#...
...........
...........
...........
...........
...#.......

...........
.#.....#...
...........
...........
...........

Falsy grids:
#.....
.....#

.....#
#.....

...#.......
...........
...........
...........
...........
.......#...
...........

...........
...#.......
...........
...........
...........
...........
.........#.

.......#...
...........
...........
...........
...........
...#.......
...........

...........
.......#...
...........
...........
...........
...........
.#.........

Snails, 40 39 bytes
\#{z|=(ul.ul.`,l~a~)(l.a3|.a|d.ea5}.,\#

\#    ,, match '#'
{
  z |  ,, Either turn in any octinilear direction, or do all the other stuff before the }
  =(   ,, If this assertion succeeds, the starting cell is an "upwards-pointing triangle"
    ul.ul.`,  ,, Go one cell up or left twice, any number of times.
              ,, This should have been one byte shorter with ul.`2 , or ul.`2+? but
              ,, the parsing of ` is buggy.
    l~a~   ,, Check that we are on the top-left cell by matching out-of-bounds to the left and then northeast
  )
  ( l.a3 |  ,, Move leftward once, then set direction to northwest; or
    .a   |  ,, Move right (the initial direction) once, then set direction to northeast; or
    d.ea5   ,, Move down once, then set direction to either northwest or northeast
}
.,    ,, Match any number of arbitrary chars (moving in the current direction)
\#    ,, match '#'

CJam, 47 bytes
Well, now that there is a shorter solution I no longer feel bad sharing my own. :) (Mostly to show that this isn't particularly difficult, even if you don't have a 2D pattern matching language...)
qN%:eeee::f+:~{S&},2f<:P0f=P::+Xf|P::-Xf|]::=:|

This uses spaces in place of # and really anything else for ..
Run all test cases online.
I really hate the duplication in P::+Xf|P::-Xf| but so far I haven't come up with anything to get rid of it.
Explanation
Don't read on if you want to figure out a solution for yourself.
First, the boring part: getting the two coordinate pairs of the two spaces in the input grid:
qN%   e# Read input and split into lines.
:ee   e# Enumerate the characters in each line. I.e. turn each character 'x into a pair
      e# [N 'x] where N is its horizontal 0-based index.
ee    e# Enumerate the lines themselves, turning each line [...] into [M [...]] where M
      e# is its vertical 0-based index.
::f+  e# This distributes the vertical index over the individual lines, by prepending it
      e# to each pair in that line. So now we've got a 2-D array, where each character 'x
      e# has been turned into [M N 'x].
:~    e# Flatten the outermost dimension, so that we have a flat list of characters with
      e# their coordinates.
{S&}, e# Filter only those lists that contain a space.
2f<   e# Truncate the two results to only their first two elements.
:P    e# Store the result in P.

Now the interesting part is how to determine whether those coordinates are aligned or not. My code computes all three axes separately:

The horizontal axis is trivial. Check whether the vertical coordinates match.
Let's look at the north-east diagonal. In the ASCII grid, there are always two antidiagonals that belong to each tri-grid diagonal:
....AV..
...AV...
..AV....

We can identify the current antidiagonal by adding up the x and y coordinates:
01234567
12345678
23456789

So we'd want 0 and 1 to belong to the same diagonal, as well as 2 and 3, and 4 and 5 and so on. That means, once we have our anti-diagonal index we want to round up to the next odd number. In other words, we take the bitwise OR with 1. (We could also round down to the next even number by bitwise AND with -2 but that's more expensive in code.)
Now the south-east diagonals:
.VA.....
..VA....
...VA...

In order to give diagonals an index, we subtract the x from the y coordinate (representing negative numbers as letters):
0abcdefg
10abcdef
210abcde

In this case, we'd want 0 and 1 to belong to the same diagonal, as well as -1 and -2, or 2 and 3. So once again, we want to round up to the next odd number.

Here is the code for that:
0f=  e# The coordinates are still on the stack. Replace each with its vertical coordinate
     e# to check for the horizontal axis.
P    e# Push the coordinates again.
::+  e# Sum each pair to get an anti-diagonal index.
Xf|  e# OR each index with 1 to round up to the next odd number.
P    e# Push the coordinates again.
::-  e# In each pair, subtract the horizontal coordinate from the vertical, to
     e# get a diagonal index.
Xf|  e# OR each index with 1.
]    e# Wrap all three index pairs in an array.
::=  e# Check equality for each pair.
:|   e# Fold bitwise OR over the results to check if at least one pair of indices
     e# was equal.

APL (Dyalog Unicode), 36 27 bytes
1∊=/¯1 0 1∘.(⊥-2|⊣×⊥)⍸⍉⍎¨↑⎕

Try it online!
-9 bytes mostly from @Bubbler
Full program that returns 0 or 1. Takes input as an array of strings, where each character is 0 for . or 1 for #.
How?
Uses the same general strategy as Martin Ender's CJam Answer. The two diagonals are indexed as y+(-1)*x and y+1*x, both rounded up to the nearest odd number. The horizontal axis is indexed as y+0*x with no rounding.
1∊=/¯1 0 1∘.(⊥-2|⊣×⊥)⍸⍉⍎¨↑⎕
                         ↑⎕  ⍝ The input array of strings, converted to a matrix
                       ⍎¨    ⍝ Evaluate each character to obtain either 0 or 1
                     ⍸       ⍝ Find the (y,x) positions of both 1s
          ∘.                 ⍝ Outer product:
    ¯1 0 1                     ⍝ For each ⍺ in 1, 0, -1:
                               ⍝ And for each (y,x) position
            (⊥     )           ⍝ Compute (⍺×x)+y (convert to base ⍺)
                                 ⍝ (⍉-Transposed earlier to get x left of y)
             -2|⊣×⊥            ⍝ If odd and ⍺ is not 0: subtract 1
1∊=/                         ⍝ Check if the two positions have equal indices on any axis

@Bubbler That exact code doesn't work e.g. for '0000' '1000' '0001' since it merges some rows together. My fix seems a bit long, but @ seems to be the main other alternative, and @1 3 is already +4 bytes, so it would not be shorter

Yeah, I realized that shortly after I posted it. It's possible to shorten the fixed version to 30 bytes btw.

@Bubbler Nice train; interestingly, that's closer to my original solution. I was able to shave off 2 more bytes since ⍵ was only used once

27 using "round down to even".

source: Stack Exchange

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

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

sort: votes


text:
Print 1 to 15, using different printers
Making a versatile integer printer is nice and all, but writing a single code that prints a lot of different numbers is cumbersome. Wouldn't it be easier to make a script that outputs a number, but also gives you a new script to get the next number?
Challenge:
Write a code that outputs a single integer N and an executable code. The next code should output N+1 and a code that can output N+2. Continue this path until you reach N = 15. (The last printed number should be 15).
Rules:

No input (assume the input is empty).
Full program or function or other convenient formats are allowed.
The first code should output 1.
You can't output leading zeros. I.e. you can't print 01 for 1.
The output must be on the format N, Code_for_N+1. Note that the output is separated by a comma and a single space. The code for N+1 has no surrounding quotation marks.  N , Code_for_N+1 is not accepted (space in front of the comma). Trailing newlines are OK.
The first character(s) of the output must be the number. (No leading spaces, or ans = N).
The printed number should not be part of the next code (the code can contain this number, but you can't take the output number as part of the code)

Example: The output for N=2 can be: 2, printer 2. In this case, printer 2 is the code for N=3. You can't use the entire output: 2, printer 2 as code for N=3.

The scripts may be in different languages
The datatypes are irrelevant (the number can be a string), but it can't be surrounded by anything (quotation marks, parentheses etc).
If there is a code outputted for N=15 then it must either print STOP! (see bonus), or don't print anything at all (not even a space or newline).

The code for N=15 can not crash (but outputting to STDERR is OK).
You are disqualified if the output code for N=15 prints 16 or anything else (except the bonus case).

Built in quine operators are not allowed.
Accessing the source file through the file system is not allowed.

Bonus:
-10 bytes if the code that prints 15 also produces a code that prints "STOP!"
Examples using Python syntax: (obviously, these will only work for the selected integers, not from 1 to 15.)
N = 1
print "1, print 2"
1, print 2

---
N = 15
print 15
15

---
N = 15   (Qualifies for the -10 bytes bonus)
print "15, print 'STOP!'"
15, print 'STOP!'

print 'STOP!'
STOP!

----

N = 15   (Qualifies for the -10 bytes bonus)
print "15, disp('STOP!')"
15, disp('STOP!')        (disp('STOP!') outputs STOP! in MATLAB)

----
N = 15   (This one is not OK. The submission is disqualified)
print "15, print 16"
15, print 16

Standard golfing rules apply! Smallest code (for N=1) in bytes win!

So, say, f=>f+"" would be invalid? (f+"" returns the function's construction code.)

@CᴏɴᴏʀO'Bʀɪᴇɴ without it, is it even possible to achieve the task...

@nicael It's been done already, at least in the js answer

@CᴏɴᴏʀO'Bʀɪᴇɴ ...in a viable way :D

The rules are confusing, can I output something like 14, print(14+1) or not?

@nyuszika7h yes you can.

Pyth + ///, 15 bytes - 10 = 5
pPt`S15", STOP!

This prints 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, STOP! in Pyth, by taking range(1,15+1) and stripping off the start and end brackets, and printing it immediately followed by ", STOP!".
The next fourteen programs are in ///, which directly outputs all programs that don't contain / or \. So the second program
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

gives 2 and the third program 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. The penultimate program, 15, STOP!, prints 15, STOP!, so the last program is just STOP!.

Cheeky. I like it. :)

Does cat count as a language?

@immibis cat doesn't do a primality test, so no.

Programs #2 and up also work in PHP. :)

JavaScript, 131238 - 10 =  131228 bytes
The naive approach turned out worse than expected. In hindsight I should have expected it. But I thought I'd share it anyway. Full code here.
Idea: Iteratively escaping and adding the N-1, ...
alert("14,alert(\"15, alert(\\\"STOP!\\\")\")")

I think this is the most backslashes in any PPCG answer ever.

I admit having used NP++ and regex for this=)

Haha, this -10 helps a lot :D

I have created a slightly less naive 87573-byte solution.

You can save some bytes with no bonus.

CJam, 26 25 24 bytes
1{", "2$)@"_~"](_F<@*}_~

Try it online.
The subsequent programs simply have the first number incremented. This runs the program 16 times.

Or with bonus for the same score:
1{", "\2$)_G<\@`+"_~"+"STOP!"`?}_~

Try it online.
The subsequent programs simply have the first number incremented. This runs the program 16 times.
Alternative solution for the bonus:
1{", "\2$)Gmd@`+"_~"+"STOP!"`\?}_~

@FryAmTheEggman http://cjam.tryitonline.net/#code=bDE1e35dc19vTm9fUyMpPn0qOw&input=MXsiLCAiMiQpQGAiX34iXTIvKF9GYTxAIlNUT1AhImA_fV9- uses Base64 to encode the program, which makes posting permalinks in comments a bit easier. </selfpromotion>

@Dennis Thanks, that was a bit of a headache :P Looks like martin wrote his own, anyway.

@FryAmTheEggman Only after I saw your link though, so thanks for the suggestion. ;)

JavaScript (ES6), 62 61 bytes - 10 bonus = 51 score
_=>"1, "+(f=n=>`_=>"`+(n<16?n+`, "+(${f(n+1)})`:`STOP!"`))(2)

Explanation
A solution which does not read it's own source code and is also not ridiculously long.
The first program constructs all 15 other programs and nests them inside each other using a recursive function. I get around the backslash issue by nesting the functions themselves (which are then cast to strings during output) rather than strings.
_=>
  "1, "                // print the first number
  +(f=n=>`_=>"`+(      // f = recursive function for printing program N
    n<16?              // for programs 2 - 15:
      n+`, "+(${       // add N to the output of the nested function
        f(n+1)         // nest the code of program N + 1
      })`
    :`STOP!"`          // program 16 just outputs "STOP!" for the bonus
  ))(2)                // start from program 2

Test

var nextProgram = '_=>"1, "+(f=n=>`_=>"`+(n<16?n+`, "+(${f(n+1)})`:`STOP!"`))(2)',
    n = 1;
while(nextProgram) {
  result.textContent += "Program " + n++ + ": " + nextProgram + "\n";
  var output = eval("(" + nextProgram + ")()");
  result.textContent += "   Output: " + output + "\n\n";
  var index = output.indexOf(",");
  nextProgram = index > 0 ? output.substr(index + 2) : null;
}

+1 for not using JavaScript's built-in feature of getting a function's body (grey area for quining)

@Callodacity How does "" + (n=>m) not count as getting the body of the function n=>m?

@Neil Actually you're right it does count - I'd overlooked that since I'd only looked at program 1 and hadn't gone through the output

Where did all the backslashes go!?

JavaScript, 50 47 44 42 44* bytes
a=_=>(x=1)+(x<15?", a="+a:"").replace(x,x+1)

It's a function which extracts its own body (just a) and makes replacements in it. Getting the function body a built-in feature of JavaScript, though not being explicitly a quine operator (if it's invalid, will remove the answer).

a=_=>(x=1)+(x<15?", a="+a:"").replace(x,x+1);
alert(a());

In case it doesn't work properly embedded there (because for me it doesn't), you can see an example there.

* - looks like the snippet produces the result without a=, making further calls impossible

How is "a builtin feature for getting the function body" not the same as a quine operator? I'm not saying it's invalid, I'm just wondering what the difference is?

I was just working on one. o_o Can't you do .replace(x++,x)?

@StewieGriffin Ones made for quining, the other is a legitimate feature.

@Stewie But the "quine operator" is supposed to return the whole program, while in my example it retrieves a function, without the purpose to make a quine (there's no built-in to return the whole program code). As you've allowed the functions, it could be similar though, therefore I was wondering.

Does a=_=>(x=1)+(x<15?`, ${a}`:"").replace(x,x+1) work?

@Cᴏɴᴏʀ Thanks, it does. 0.o I've got 44!

Crossed out 44 is regular 44 XD As an aside, I don't like ES6fiddle, because it doesn't fit the exact specifications on arrow functions, especially when stringifying an arrow function and treating this as an undefined keyword.

@CᴏɴᴏʀO'Bʀɪᴇɴ I can of course make a snippet, but I use Safari and it doesn't support ES6 yet, so I test it in that fiddle.

Oh, I see. I should make a real ES6 interpreter :P

This is only valid if you do a=_=>(x=1)+(x<15?",a="+a:"").replace(x,x+1).

@ՊՓԼՃՐՊՃՈԲՍԼ Hm, different environments interpret differently. You see _=>... when using the snippet, right? Ok, I'll edit.

Matlab, 226 212 - 10 = 202 bytes
Thanks to @StewieGriffin for a few bytes=)
'awFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)

The first part is a string that represents the second line (below), the actual code (just shifted by 9). In Matlab, strings are matrices filled with characters, so you can easily perform the shifts by just adding/substracting a scalar. So the program just prints out the same string* again, plus the same string but shifted which results in the code.
*Not quite: The first byte is the counter which needs to be increased in each iteration.
The quine trick with the string was shamelessly stolen from here.
'awFjw|Dro)w1:26B?G:>DwF0\}xy*0Dnu|nDwFdw~v;|}{1w1:26B?2505)05<B5w1:24:5w1;Cnwm25<B5>B5w1;Cnwm26B500fDnwmDmr|y1w2';
n=ans;if n(1)-96>15;n='Stop!';else;n=[num2str(n(1)-96),', ',39,n(1)+1,n(2:end),39,59,n(2:end)-9,''];end;disp(n)

Here the last few lines of the sequence copied from the console:
>> 'mwFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
13, 'nwFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
>> 'nwFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
14, 'owFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
>> 'owFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
15, 'pwFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
>> 'pwFjw|DWFw1:2DVFw1;Cnwm2Dro)WG:::DwF0\]XY*0Dnu|nDwFdw~v;|}{1W6B?2505)05<B5W4:5V5<B5>B5V6B500fDnwmDmr|y1w2';n=ans;N=n(1);M=n(2:end);if N>111;n='STOP!';else;n=[num2str(N-96),', ',39,N+1,M,39,59,M-9,''];end;disp(n)
STOP!

Python 2.7.10, 196 92 - 10 = 82 bytes
Whee!!! This was fun.  Much shorter now. :P
n=1;a='n=%d;a=%r;print n,a%%(n+1,a)if n!=15else"STOP!"';print n,a%(n+1,a)if n!=15else"STOP!"

Explanation:
I started with this:
a='a=%r;print a%%a';print a%a

That is just a simple quine.
This is that with a counter added:
n=1;a='n=%d;a=%r;print n,a%%(n+1,a)';print n,a%(n+1,a)

n is a counter variable that is printed at the beginning.  Then when its prints the n= part, it substitutes n+1 for the %d.  So from here it will count up infinitely.
And here is the final version. It adds an if clause to stop at 15, and prints "STOP!" as well.
n=1;a='n=%d;a=%r;print n,a%%(n+1,a)if n!=15else"STOP!"';print n,a%(n+1,a)if n!=15else"STOP!"

Old code:
a= ['if num==15:print"STOP!!!";exit()','print num','print"a=",a','print"num=",num+1', 'for s in a:print s']
num= 1
print num
if num==15:print"STOP!!!";exit()
print"a=",a
print"num=",num+1
for s in a:print s

Never going to win, but fun. :P Much shorter now, though I still don't stand a chance. :P

Wow. Can you add an explanation because this is cool but I have no idea what's going on :D

@Sherlock9 done.  Thanks for your appreciation.

If I cut and paste this into an interactive python 2.7.6 session it complains that there's no spaces before the elses.

@eric I am using python 2.7.10 and it works for me...

PowerShell, (215-10)=205 197 167 106 104 103 bytes
$d='$c=(,1*{2}).count;$d={0}{1}{0};(("$c, $d"-f[char]39,$d,($c+1)),$c)[$c-eq15]';"1, $d"-f[char]39,$d,2

(If your only tool is PowerShell, every problem looks like a nail. Wait...)
Essentially, we start with setting $d equal to a big-ole-lengthy string of an almost-quine of the original code. It outputs 1 and then $d with the format operator -f to correctly populate the {0},{1},{2} stand-ins, incrementing the {2} number in the ,1*{2} section by one each time.
The ,x*y operation in PowerShell creates a new array of y items, each of which is equal to x. For example, ,2*3 is equivalent to @(2,2,2).
This means, the first output will be 1, $c=(,1*2).length;$d=(etc...), so when the second code is executed, $c will equal the count of the array @(1,1), or 2, etc. Note that $c isn't used as a variable in the original code, just in subsequent runs.
Stops when it prints 15 by simply calculating whether $c equals 15 and then indexing into an array, the 0th element is $c, $d as described above, the other is just 15. Thus, when $c is 15, it'll output 15 and nothing else. Doesn't qualify for the bonus, because "15, {0}STOP!{0}" is 5 characters too long for the -10 to be worthwhile.
Requires a PowerShell terminal of width > ~150. Or for you to manually remove the extra linebreak (that the terminal helpfully inserts on output wrap) when copy-pasting the code. Or for you to capture output into a variable and then re-execute that variable. Etc.
Edit 1 -- Saved some bytes by removing the "STOP!" wording.
Edit 2 -- Durr, don't use .length each time, just call it once
Edit 3 -- Doesn't need to be a quine, so the initial run can be a lot shorter
Edit 4 -- Changed from using strings to arrays to calculate $c, which saved two bytes. I'm pretty sure this is almost optimal for this approach.
Edit 5 -- Saved another byte by directly counting equality rather than modding

The Windows 10 console window no longer copies the output wrap linebreak.

Befunge, 57 - 10 = 47 bytes
1:'!`'#*j:.',,1+:9`''*'0++,1#;:0g:48*`j@,1+;"!POTS",,,,,@

This one is awesome. Try it here.

The right casing for the stop message is STOP!

@zyabin101 fixed.

JavaScript, 79 - 10 = 69 bytes
s='STOP!';for(i=15;i;){s=i--+',alert("'+s.replace(/[\\"]/g,"\\$&")+'")'};alert(s)

Without using Function.prototype.toString in any way at all.

SMBF, 28 bytes
\x10 represents a literal byte (decimal value 16). The integer is output as an integer (byte). So the first character output is \x01. The program then prints ", ". When printing its own source, it prints an extra + at the beginning.
+.<-<<.>.>[[<]>.[.>]<[-]], \x10

Explanation:
+.                                  Increment number and print
  <-                                Pre-decrement loop counter
    <<.>.>                          Print comma and space from own source
          [             ]           Only execute if loop counter != 0
           [<]>.                    Move to left of source, then print `+`
                [.>]                Print entire source.
                    <[-]            Zero out the loop counter so this program halts.
                         , \x10     The comma, space, and loop counter used earlier.
                                    Input is empty, so `,` doesn't do anything.

Note that you cannot run this in a standard interpreter because it requires a hex literal in the input. You also need a special terminal for hex output to work properly.

Batch, 73 + 5 - 10 = 68 bytes
@set a=STOP!
@for /l %%a in (15,-1,1)do @set a=%%a, @echo !a!
@echo %a%

Requires CMD /V:ON so I added 5 bytes for that.

Python 2.7, 107 characters
By using recursion and not writing a quine, I thought I could save a lot, which is true, but not good enough. Although not a winner, I think the approach is fun to share.
I started by making up a string for N=4, escaping the \ and " characters.
print "1, print \"2, print \\\"3, print \\\\\\\"4, print \\\\\\\\\\\\\\\"STOP!\\\\\\\\\\\\\\\"\\\\\\\"\\\"\""

Then I created a lambda function that creates this string, based on a start index and a stop index, using recursion. This is it:
l=lambda n,m:str(n)+", print "+"\\"*(2**(n-1)-1)+"\""+l(n+1,m)+"\\"*(2**(n-1)-1)+"\"" if n<m else "STOP!"

Use it like this:
print l(1,15)

Output: [32902 characters, too long to handle]
So, it seems that my kolmogorov complexity approach isn't that successful ;-)

, 30 chars / 47 bytes (non-competitive)
⟮a=1)+(a<ḏ?⬬+ⒸⅩ222+ᶈ0:⬯)ē(a,⧺a

Try it here (Firefox only).
Finally found a good ol' true quine for .
Explanation
Here's the true quine that I used: ⟮ⒸⅩ222+ᶈ0
You see it in my answer? Hopefully, y'all will be able to expand from there.

Bash, 78 74 73 - 10 = 63 bytes (Example, can't win)
p='if(($((++a>15))));then unset a p;fi;echo ${a-STOP\!}${p+, $p}';eval $p

Coming in late, but saw bash hadn't been tried so gave it a go.  First gulf challenge and quine-like puzzle.  They're fun!
Explanation:
This works because a steps from 1 to 15 and is then unset along with p.  The script (stored in p) prints them both out if they're set and "STOP!" otherwise.   The initially unset a is set to 0 because it appears in an arithmetic expansion.

Keg+PHP, 19-10=10 bytes
ï_(. \,,,)\!POTS(,

Counts from 1 to 15 and then stops. TIO
Keg, 13 bytes
ï_(. \,,,).

Python 2, 68 (-10) bytes, Python 3, 69 (-10) bytes
My previous answers were incorrect. That's now fixed :)
Python 2 (68 bytes, 58 points)
a,b="print'%d, a,b=%r,%d;exec a'%(b,a,b+1)*(b<16)or'STOP!'",1;exec a

Try it online!
Python 3 (69 bytes, 59 points)
a,b="print(f'{b}, a,b=%r,{b+1};exec(a)'%a*(b<16)or'STOP!')",1;exec(a)

Try it online!
How it works:

I started from the quine a="print("a=%r;exec(a)"%a);exec(a)"
I assign b to the value to be printed
Then I print b,  and the quine replacing b by b+1
If b is equal to 16, I print STOP! intead

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


text:
Letters, Get Moving! Pt. 2
The first Letters, Get Moving! was very popular, but had limited participation. This one will be easier to solve, but hopefully involve some tricks in golfing.
You are given a string of only lowercase letters. For each letter, with position in the alphabet m, move it so it becomes the mth letter from the end. If the value of m is longer than the length of the string, move it to the very front. Output only the fully transformed string.
Examples:
"giraffe"

'g' is the 7th letter in the alphabet, it is already the 7th letter from the back, so leave it.
'i' is the 9th letter, since 9 is bigger than the length of the word, it goes to the front, so the string becomes igraffe
'r' is the 18th letter, like 'i' it goes to the front: rigaffe
'a' is the 1st letter, it goes to the very end: rigffea
'f' is the 6th letter, it becomes the 6th from the back: rfigfea
the next 'f' is also the 6th letter, so it also goes to 6th from the back : rffigea
'e' is the 5th letters, it goes to 5th from the back: rfefiga

"flower"

'f' (6) => flower
'l' (12) => lfower
'o' (15) => olfwer
'w' (23) => wolfer
'e' (5) => weolfr
'r' (18) => rweolf

"pineapple"

'p' (16) => pineapple
'i' (9) => ipneapple
'n' (14) => nipeapple
'e' (5) => nipaepple
'a' (1) => nipepplea
'p' (16) => pnipeplea
'p' (16) => ppnipelea
'l' (12) => lppnipeea
'e' (5) => lppneipea (make sure you move the e that hasn't been moved already! Here it doesn't matter, but below it does.)

Thanks to @Neil for improving the test cases with these 3 additions:
"pizza"

'p' (16) => pizza
'i' (9) => ipzza
'z' (26) => zipza
'z' (26) => zzipa (moving the second z!)
'a' (1) => zzipa

"abracadabra"

'a' (1) => bracadabraa
'b' (2) => racadabraba
'r' (18) => racadabraba
'a' (1) => rcadabrabaa
'c' (3) => radabrabcaa
'a' (1) => rdabrabcaaa
'd' (4) => rabrabcdaaa
'a' (1) => rbrabcdaaaa
'b' (2) => rrabcdaaaba
'r' (18) => rrabcdaaaba
'a' (1) => rrbcdaaabaa

"characters"

'c' (3) => haractecrs
'h' (8) => arhactecrs
'a' (1) => rhactecrsa
'r' (18) => rhactecrsa
'a' (1) => rhctecrsaa
'c' (3) => rhtecrscaa
't' (20) => trhecrscaa
'e' (5) => trhcrescaa
'r' (18) => rtrhcescaa
's' (19) => srtrhcecaa

CJam, 41 38 bytes
lee_S+W%\{Xa-X1='`-/(Xa+\L*+}fX1>W%1f=

Test it here.

Upvoting as it's the only other answer that works on all of my test cases.

Shortest to pass all test cases!

Python 3, 78 bytes.
Saved 2 bytes thanks to orlp.
Saved 7 bytes thanks to DSM.
x=input()
y=[]
for z in x:m=max(len(x)-ord(z)+96,0);y[m:m]=z
print(''.join(y))

Builds the word as a list then joins it.

(q-p,0)[p>q] is longer than min(q-p,0).

It is, but that doesn't do the same thing. That's always going to return 0 or a negative.

Sorry, I meant max(q-p,0).

Python 2, 86 bytes
a=input();k=list(a)
for i in a:k.remove(i);k.insert(ord(i)-97,i)
print"".join(k)[::-1]

Python 3, 88 bytes
a=input();k=list(a)
for i in a:k.remove(i);k.insert(ord(i)-97,i)
print("".join(k)[::-1])

Examples
Python 2:
$ python2 test.py
"flower"
rweolf

Python 3:
$ python3 test.py
flower
rweolf

k.remove removes the first instance, so this is going to fail for something like baa.

Javascript ES6, 136 134 131 bytes
s=>([...s].map(c=>{s=s.replace(c,'');p=s.length+97-c.charCodeAt();s=s.substr(0,p)+c.toUpperCase()+s.substring(p)}),s.toLowerCase())

Note that I take great care not to move the same character twice, otherwise pizza turns into zipza when it should be zzipa. There's also an edge case dealing with not removing characters prematurely; characters becomes maybe srtrchaeac or srtrheccaa if you do it wrongly but it should be srtrhcecaa. Another tricky word is abracadabra for which the output rrabaaadcba would be incorrect; rrbcdaaabaa would be correct.
Edit: Shaved off two bytes by using substring which automatically coerces its arguments to the range 0..length.
Edit: Shaved off three bytes by changing the first substring to substr as suggested by user81665.

I think you could use substr instead of substring.

slice is better (I think).

@ՊՓԼՃՐՊՃՈԲՍԼ He can't because passing negative numbers into slice breaks it.

oh forgot about that.

Yeah, there was a little mistake with the pizza test case you put on my post, but I fixed it.

Ugh, and I thought I'd checked against my answer too. Very sorry about that, and also the other typos that crept in (my fault for doing it so late at night.)

Knight (v2), 58 bytes
;=i~!=sP;W<=i+1iLs=sI>0=l-L=tSs iT@-A=cGs iT95+c tSt lFcOs

Try it online!
expanded:
; = idx ~1 # ie -1
; = str PROMPT
; WHILE < (= idx + idx 1) (LENGTH str)
    ; = chr GET str idx 1 # ie get the char at index `idx`
    ; = tmp SET str idx 1 "" # delete that chr
    ; = index - (LENGTH str) (- (ASCII chr) 95)
    : = str
        IF (> 0 index)
            : + chr tmp
        # ELSE:
            : SET tmp index 0 chr # insert the char there
: OUTPUT str

How do you run this?  When I click the triangle here I get an "Error: Missing argument 2 for func ';'"...

D'oh! I forgot to copy the Os at the end. updating now

Pyth, 18 17 bytes
uXeS,Z-lzhx;HGHzk

Test Suite.
Iterates using reduce over the input string, inserting into a string, base case empty string, at the correct position.

, 23 chars / 40 bytes
ᴉⓜΞăМƲ ïꝈ-ᶛą$,0),0,$;Ξ⨝

Try it here (Firefox only).
Explanation
ᴉⓜΞăМƲ ïꝈ-ᶛą$,0),0,$;Ξ⨝ // implicit: ï=input, ᴉ=input split into chars, Ξ=empty array, ᶛ=lowercase alphabet
ᴉⓜ                      // map over input chars
   ΞăМƲ ïꝈ-ᶛą$,0),0,$;   // use splice to insert map item into Ξ at requested index
                      Ξ⨝ // join Ξ
                         // implicit output

Ruby, 56 bytes
Port of Morgan Thrapp's Python answer.
->x{y=[]
x.chars{y[[x.size-_1.ord+96,0].max,0]=_1}
y*""}

Attempt This Online!

05AB1E, 25 bytes
.āDvyUΣNsXQiIgAXнk2t+-]€н

Outputs as a list of characters.
Try it online or verify all test cases.
Explanation:
Unfortunately 05AB1E lacks a builtin to insert a character at a certain index without removing the current character at that index. So instead I'm using a sort-by, where I only modify the index of the current character.
.ā                  # Enumerate the (implicit) input-string, pairing each character with
                    # its (0-based) index (to make them all unique)
  D                 # Duplicate it
   v                # Loop over each pair `y` in this list:
    yU              #  Put pair `y` in variable `X`
    Σ               #  Sort the list of pairs by:
     N              #   Push the current sort-index
     s              #   Swap so the current pair is at the top of the stack
      XQi           #   If it's equal to pair `X`:
         Ig         #    Push the input-length
           A        #    Push the lowercase alphabet
            Xн      #    Push the character of pair `X`
              k     #    Get the (0-based) index of this character in the alphabet
               2t+  #    Add sqrt(2) to it (+1 to make it 1-based, and +0.414 so it'll
                    #    come before the actual integer-index)
                  - #    Subtract this index from the input-length
   ]                # Close both the sort-by and loop
    €               # Map over each pair
     н              #  And only leave its character
                    # (after which the list of characters is output implicitly)


text:
Paint by Numbers (using programming, not numbers)
Your task is to create a program which takes a black-and-white outlined image (example images are below) and fills it in with colour. It is up to you how you section off each region and which colour to fill it with (you could even use an RNG).
For example:

As you can see I am clearly an artist of a superior calibre when it comes to MS Paint.

Scoring
This is a popularity contest, so the answer with the most net votes wins. Voters are encouraged to judge answers by

Input criterion: any image that consists of white/light-grey background and black/dark-grey outlines
How well the colouring is done; meaning few or no areas are white unlike the above (unless you obviously intend to use white e.g. for clouds)
Customisability of the colours used in certain sections
How well the system works on a range of different images (of varying detail)
Post how long your program takes per image. We might not be playing code golf, but shorter, faster and more efficient code should be regarded as better
Should output the new image either onto the screen or to a file (no larger than 2MB so that it can be shown in the answer)
Please justify why you chose to output to that image type and comment/explain the workings of your code
The applicability of the colour used to the respective shape it is bound by (realistic colour scheme i.e. grass is green, wooden fences are brown etc.)

"I could randomly color each area, but if I could identify the "fence" and make it similarly colored, then that's
  something that deserves upvotes." - NathanMerrill

Seeing as this is a popularity contest, you can also optionally judge by:

Overall appeal (how good the image looks)
Artistic flair; if you can program in shading or watercolour-style colouring etc.

In general, the smallest outputted image (file size) of the highest quality, with the fasted program and the highest public vote will win.
If you have other judging specifications that you think should be used, please recommend them in the comments of this post.

Examples
I own nothing; all example images are of a creative commons license.

Source: https://pixabay.com/ro/stejar-arbore-schi%C5%A3%C4%83-natura-303890/

Source: http://www.freestockphotos.biz/stockphoto/10665

Source: http://crystal-rose1981.deviantart.com/art/Dragon-Tattoo-Outline-167320011

Source: http://jaclynonacloudlines.deviantart.com/art/Gryphon-Lines-PF-273195317

Source: http://captaincyprus.deviantart.com/art/Dragon-OutLine-331748686

Source: http://electric-meat.deviantart.com/art/A-Heroes-Farewell-280271639

Source: http://movillefacepalmplz.deviantart.com/art/Background-The-Pumpkin-Farm-of-Good-old-Days-342865938

EDIT: Due to anti-aliasing on lines causing non-black/white pixels and some images that may contain grey instead of black/white, as a bonus challenge you can attempt to deal with it. It should be easy enough in my opinion.

To everyone: please does not downvote/close this as an "art contest" - there is more to it

Welcome to PPCG! I applaud you for having the courage to not only have your first post be a challenge, and not only a pop-con challenge, but an artistic challenge on top of it all. Good luck, I wish you the best, and if you stick around I think you'll be going far here.

@NathanMerrill does that edit suffice?

@TimmyD thanks for such a warm welcome; a real confidence boost!

@OliverGriffin I'm voting against closing and also, I've added in the images you linked for you. You can remove the comments, if you wish.

I finally found an approach that probably won't stack overflow, but now it's running kind of slowly.

@SuperJedi224 "probably"

I've voted to close this question because it does not have objective winning criterion. The answer itself cannot be judged by a color scheme or the author's "artistic style", as this is an opinion that varies from person to person. Please consider removing these criterion. I believe that (among other things) would strengthen the question. You may also want to consider clarifying some of the input/output specs.

@OliverGriffin much better.  One last improvement I'd suggest is to take the advice of Zach.  I'd recommend editing "Artistic style" to something along the lines of how well the colors mix with each other in respect to their shapes.  I could randomly color each area, but if I could identify the "fence" and make it similarly colored, then that's something that deserves upvotes.

@ZachGates all due respect, it is tagged as a popularity contest, so it's obvious that opinion will vary from person to person. Taking your other advice into account, I attempted to clarify the input/output specs and an objective winning criterion. I hope this satisfies your needs enough to reopen the post, but if you have other suggestions, feel free to mention them. At the end of the day, I view this as a fun activity and consider anyone who partakes a winner.

I've voted to reopen your question and have changed my -1 to a +1. Good job editing and adding additional information. Also, I applaud you for being so receptive to community criticism. Welcome to PPCG! Hope you enjoy it.

@ZachGates thank you. I am eager to see what answers people can come up with; though I must question, is anybody actually working towards an answer?

With the new "applicability of colour" criterion, I think new, simpler test cases might be useful. I doubt most people would account for dragon-belly-white if their program found an oval-shaped area to fill.

@Sp3000 sorry, i barely caught a word of that. Could you please rephrase?

Basically I mean that I think the example images are fairly complex to guess a reasonable colour scheme for, and that adding a few simpler test cases would be good (also 3/5 images consist of a sole mythical creature, and I think it'd be better if there's more variety in the images)

@Sp3000 It wasn't my intention to use so many mythical creatures, I did simply choose random creative common images from the web. I added a tree and a chicken for diversity. I was thinking along the lines of grouping bounding boxes that would use a certain colour, thus giving the programmer control if some time were dedicated towards the 'colouring' aspect rather than just the coding. Still, the answerer could use a different image if that would make it easier.

I don't get the point of smallest outputted image. 1x1 pixel image is the winner?

If all the images are Creative Commons, you will also need to state which Creative Commons license applies and provide attribution for each image (it's fine to post them here but all Creative Commons licenses require attribution).

Also, providing attribution linking back to the original material gives people here the opportunity to let the original artists know about this question - I imagine they might like to see what their work has gone on to inspire :)

@trichoplax thanks that's a very good point, and (I hope) a great idea for the artists! I had the links but I seem to have lost them. I will reverse image search to find the pages I got them from then post the links. Although my initial problem was that my reputation wasn't high enough to post all of the links but given how many upvotes the question got (thank you) I should now be able to. Erm, yes it does refer to file size, I thought I changed it to clarify in the original post after seeing that comment. Should I also have replied to inform him of the changes?

No it's good that you updated the question - then everyone can understand without reading all the comments. I should have noticed the question had been updated - I'll delete my comment...

Spectral airbrushing (Python, PIL, scipy)
This uses a sophisticated mathematical algorithm to produce colourful nonsense. The algorithm is related to Google's PageRank algorithm, but for pixels instead of web pages.
I took this approach because I thought that unlike flood-fill based methods it might be able to cope with images like the chicken and the tree, where there are shapes that aren't entirely enclosed by black lines. As you can see, it sort of works, though it also tends to colour in different parts of the sky in different colours
For the mathematically minded: what it's doing is essentially constructing the adjacency graph of the while pixels in the image, then finding the top 25 eigenvectors of the graph Laplacian. (Except it's not quite that, because we do include the dark pixels, we just give their connections a lower weight. This helps in dealing with antialiasing, and also seems to give better results in general.) Having found the eigenvectors, it creates a random linear combination of them, weighted by their inverse eigenvalues, to form the RGB components of the output image.
In the interests of computation time, the image is scaled down before doing all this, then scaled back up again and then multiplied by the original image. Still, it does not run quickly, taking between about 2 and 10 minutes on my machine, depending on the input image, though for some reason the chicken took 17 minutes.
It might actually be possible to turn this idea into something useful, by making an interactive app where you can control the colour and intensity of each of the eigenvectors. That way you could fade out the ones that divide the sky into different sections, and fade in the ones that pick up on relevant features of the image. But I have no plans to do this myself :)
Here are the output images:

(It didn't work so well on the pumpkins, so I omit that one.)
And here is the code:
import sys
from PIL import Image
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as spl
import os
import time

start_time = time.time()

filename = sys.argv[1]
img = Image.open(filename)
orig_w, orig_h = img.size

# convert to monochrome and remove any alpha channel
# (quite a few of the inputs are transparent pngs)
img = img.convert('LA')
pix = img.load()
for x in range(orig_w):
    for y in range(orig_h):
        l, a = pix[x,y]
        l = (255-a) + a*l/255
        a = 255
        pix[x,y] = l,a
img = img.convert('L')

orig_img = img.copy()

# resize to 300 pixels wide - you can get better results by increasing this,
# but it takes ages to run
orig_w, orig_h = img.size
print "original size:", str(orig_w)+ ', ' + str(orig_h)
new_w = 300
img = img.resize((new_w, orig_h*new_w/orig_w), Image.ANTIALIAS)

pix = img.load()
w, h = img.size
print "resizing to", str(w)+', '+str(h)

def coords_to_index(x, y):
    return x*h+y

def index_to_coords(i):
    return (int(i/h), i%h)

print "creating matrix"

A = sp.lil_matrix((w*h,w*h))

def setlink(p1x, p1y, p2x, p2y):
    i = coords_to_index(p1x,p1y)
    j = coords_to_index(p2x,p2y)
    ci = pix[p1x,p1y]/255.
    cj = pix[p2x,p2y]/255.
    if ci*cj > 0.9:
        c = 1
    else:
        c =  0.01
    A[i,j] = c
    return c

for x in range(w):
    for y in range(h):
        d = 0.
        if x>0:
            d += setlink(x,y,x-1,y)
        if x<w-1:
            d += setlink(x,y,x+1,y)
        if y>0:
            d += setlink(x,y,x,y-1)
        if y<h-1:
            d += setlink(x,y,x,y+1)
        i = coords_to_index(x,y)
        A[i,i] = -d

A = A.tocsr()

# the greater this number, the more details it will pick up on. But it increases
# execution time, and after a while increasing it won't make much difference
n_eigs = 25

print "finding eigenvectors (this may take a while)"
L, V = spl.eigsh(A, k=n_eigs, tol=1e-12, which='LA')

print "found eigenvalues", L

out = Image.new("RGB", (w, h), "white")
out_pix = out.load()

print "painting picutre"

V = np.real(V)
n = np.size(V,0)
R = np.zeros(n)
G = np.zeros(n)
B = np.zeros(n)

for k in range(n_eigs-1):
    weight = 1./L[k]
    R = R + V[:,k]*np.random.randn()*weight
    G = G + V[:,k]*np.random.randn()*weight
    B = B + V[:,k]*np.random.randn()*weight

R -= np.min(R)
G -= np.min(G)
B -= np.min(B)
R /= np.max(R)
G /= np.max(G)
B /= np.max(B)

for x in range(w):
    for y in range(h):
        i = coords_to_index(x,y)
        r = R[i]
        g = G[i]
        b = B[i]
        pixval = tuple(int(v*256) for v in (r,g,b))
        out_pix[x,y] = pixval

out = out.resize((orig_w, orig_h), Image.ANTIALIAS)
out_pix = out.load()
orig_pix = orig_img.load()

for x in range(orig_w):
    for y in range(orig_h):
        r,g,b = out_pix[x,y]
        i = orig_pix[x,y]/255.
        out_pix[x,y] = tuple(int(v*i) for v in (r,g,b))

fname, extension = os.path.splitext(filename)
out.save('out_' + fname + '.png')

print("completed in %s seconds" % (time.time() - start_time))

This is REALLY cool. Probably one of my favourites so far. You did an excellent job of handling the antialiasing and the open ended areas, and someone finally coloured in Link! (Been waiting for that :-P save set to desktop) I wonder what my old English teacher would have said about that as a static image... "It shows the two sides of his heart, one side there is peace and on the other there is the fighting necessary to obtain that peace". Enough about my love for the Legend of Zelda games... It really is a shame that it takes so long. How big were the resulting files? P.s. Love images 4&5

I'm glad you like it! The files are pngs the same dimensions as the original images - they're around 200-400kB in size.

This is amazing and deserves far more upvotes than it has.

this is beautiful... can you explain it like i was a 3rd grader? "eigenvalue of the laplacian".. kinda lost me a little bit.

@donbright a 3rd grader who could understand eigenvectors would be a very bright kid indeed - I'm not sure it's possible for me to explain the algorithm at that level. But let me try anyway: imagine that we print out the picture onto a stiff sheet of metal. Then we carefully cut away all the black lines and replace them with something much more flexible, like elastic. So the white parts are metal plates and the black parts are flexible fabric. Next we hang the whole thing in the air from string, so it's free to move. Now if we tap the metal plates, they will vibrate...

@donbright (continued) ...Depending on how you hit the metal plate, it will vibrate in different ways. Maybe sometimes just one of the metal parts will vibrate and not the others, but other times (because they're connected by elastic), hitting one plate will start another one moving as well. These different ways of vibrating are called vibrational modes. This program simulates some of the vibrational modes of this metal plate, but instead of generating sound, it uses them to work out which colour to draw.

@donbright You can also see here for more on visualising the vibrations of metal plates.

@donbright (this more technical explanation might also lose you a bit, but this explanation works because the vibrational modes of a plate are also calculated using an eigenvector calculation. Though it's possible it's not quite the same calculation that my code does - I'm not really sure.)

Python 2 + PIL too, my first coloring book
import sys, random
from PIL import Image

def is_whitish(color):
    return sum(color)>500

def get_zone(image, point, mask):
    pixels = image.load()
    w, h = image.size
    s = [point]
    while s:
        x, y = current = s.pop()
        mask[current] = 255
        yield current
        s+=[(i,j) for (i,j) in [(x,y-1),(x,y+1),(x-1,y),(x+1,y)] if 0<=i<w and 0<=j<h and mask[i,j]==0 and is_whitish(pixels[i,j])]

def get_zones(image):
    pixels = I.load()
    mask = Image.new('1',image.size).load()
    w,h = image.size
    for y in range(h):
        for x in range(w):
            p = x,y
            if mask[p]==0 and is_whitish(pixels[p]):
                yield get_zone(image, p, mask)

def apply_gradient(image, mincolor, maxcolor, points):
    minx = min([x for x,y in points])
    maxx = max([x for x,y in points])
    miny = min([y for x,y in points])
    maxy = max([y for x,y in points])
    if minx == maxx or miny==maxy:
        return
    diffx, diffy = (maxx - minx), (maxy-miny)
    stepr = (maxcolor[0] - mincolor[0] * 1.0) / diffy
    stepg = (maxcolor[1] - mincolor[1] * 1.0) / diffy
    stepb = (maxcolor[2] - mincolor[2] * 1.0) / diffy
    r,g,b = mincolor
    w, h = (abs(diffx+1),abs(diffy+1))
    tmp = Image.new('RGB', (w,h))
    tmppixels = tmp.load()
    for y in range(h):
        for x in range(w):
            tmppixels[x,y] = int(r), int(g), int(b)
        r+=stepr; g+=stepg; b+=stepb
    pixels = image.load()
    minx, miny = abs(minx), abs(miny)
    for x,y in points:
        try:
        pixels[x,y] = tmppixels[x-minx, y-miny]
    except Exception, e:
            pass

def colors_seq():
   yield (0,255,255)
   c = [(255,0,0),(0,255,0),(0,0,139)]
   i=0
   while True:i%=len(c);yield c[i];i+=1

def colorize(image):
    out = image.copy()
        COLORS = colors_seq()
    counter = 0
    for z in get_zones(image):
        c1 = COLORS.next()
        c2 = (0,0,0) if counter == 0 else (255,255,255)
        if counter % 2 == 1:
            c2, c1 = c1, c2
        apply_gradient(out, c1, c2, list(z))
        counter +=1
    return out

if __name__ == '__main__':
    I = Image.open(sys.argv[-1]).convert('RGB')
    colorize(I).show()

I did quite the same as CarpetPython did, except that I fill the region with 'gradients', and use a different color cycle.
My most magnificient colorings :

Computation times on my machine :

image 1 (chinese dragon): real    0m2.862s user   0m2.801s sys    0m0.061s

image 2 (gryffon) : real  0m0.991s user   0m0.963s sys    0m0.029s

image 3 (unicornish dragon): real 0m2.260s user   0m2.239s sys    0m0.021s

Nice gradients! When you stick a for loop inside a for loop with nothing else inside the first one do you not need to further indent?

sure you do ! it's was copy/paste issue...

Python 2 and PIL: Psychedelic Worlds
I have used a simple algorithm to flood fill each white-ish area with a color from a cycling palette. The result is very colorful, but not very lifelike.
Note that the "white" parts in these pictures are not very white. You will need to test for shades of grey too.
Code in Python 2.7:
import sys
from PIL import Image

WHITE = 200 * 3
cs = [60, 90, 120, 150, 180]
palette = [(199,199,199)] + [(R,G,B) for R in cs for G in cs for B in cs]

def fill(p, color):
    perim = {p}
    while perim:
        p = perim.pop()
        pix[p] = color
        x,y = p
        for u,v in [(x+dx, y+dy) for dx,dy in [(-1,0), (1,0), (0,1), (0,-1)]]:
            if 0 <= u < W and 0 <= v < H and sum(pix[(u,v)]) >= WHITE:
                perim.add((u,v))

for fname in sys.argv[1:]:
    print 'Processing', fname
    im = Image.open(fname)
    W,H = im.size
    pix = im.load()
    colornum = 0
    for y in range(H):
        for x in range(W):
            if sum(pix[(x,y)]) >= WHITE:
                thiscolor = palette[colornum % len(palette)]
                fill((x,y), thiscolor)
                colornum += 1
    im.save('out_' + fname)

Example pictures:

The scary part is that the colours actually seem to work. How long did it take you to colour in each image and how big were the files?

The program colors each image in about 2 seconds. The output image dimensions are the same as the input files. The file sizes are mostly 10% to 40% smaller than the originals (probably because different jpeg compression settings are used).

I'm thoroughly impressed at how short the code is! I also like how you effectively limit the colours available to use, thus keeping to a set pallet. I actually really do like it, it kind of gives of a grunge (is that the right word? I am not an artist) vibe.

@OliverGriffin, I am glad you like it. I was aiming for a palette without bright or dark colors, but still having some contrast. This color range seemed to have the most pleasing results.

Matlab
function [output_image] = m3(input_file_name)
a=imread(input_file_name);
b=im2bw(a,0.85);
c=bwlabel(b);
h=vision.BlobAnalysis;
h.MaximumCount=10000;
ar=power(double(step(h,b)),0.15);
ar=[ar(1:max(max(c))),0];
f=cat(3,mod((ar(c+(c==0))-min(ar(1:end-1)))/ ...
    (max(ar(1:end-1))-min(ar(1:end-1)))*0.9+0.8,1),c*0+1,c*0+1);
g=hsv2rgb(f);
output_image=g.*cat(3,c~=0,c~=0,c~=0);

We use HSV colorspace and choose each regions Hue based on it's relative size between the white regions. The largest region will be blue (Hue = 0.7) and the smallest region will be violet (Hue = 0.8). The regions between these two sizes are given Hues in the range 0.7 -> 1=0 -> 0.8. The Hue on the range is linearly selected in respect to the function area^0.15.
Saturation and Value is always 1 for every non-black pixel.
It takes less then 1 second to color an image.
The 3 pictures with closed regions where the algorithm works decently:

And the rest of the images:

On these images there are big white connected regions  which should be ideally colored by multiple colors (this problem was nicely solved in Nathaniel's solution.

Nice and short code for some pretty colour coordinated results! I like how you used the area to help determine the hue. How long did it take to process the average image and why didn't it work on some of the more detailed images? Were the areas too small?

@OliverGriffin Anwered in my post and added the rest of the images.

Python 3 with Pillow
The code is a bit long to include in this answer, but here's the gist of it.

Take the input image and, if it has an alpha channel, composite it onto a white background. (Necessary at least for the chicken image, because that entire image was black, distinguished only by transparency, so simply dropping the alpha was not helpful.)
Convert the result to greyscale; we don't want compression or anti-aliasing artifacts, or grey-lines-that-aren't-quite-grey, to mess us up.
Create a bi-level (black and white) copy of the result. Shades of grey are converted to black or white based on a configurable cutoff threshold between white and the darkest shade in the image.
Flood-fill every white region of the image. Colours are chosen at random, using a selectable palette that takes into account the location of the starting point for the flood-fill operation.
Fill in the black lines with their nearest-neighbour colours. This helps us reintroduce anti-aliasing, by keeping every coloured region from being bordered in jaggy black.
Take the greyscale image from step 2 and make an alpha mask from it: the darkest colour is fully opaque, the lightest colour is fully transparent.
Composite the greyscale image onto the coloured image from step 5 using this alpha mask.

Those last few steps, unfortunately, have still not eliminated lighter "halos" that are visible in darker-coloured regions, but they've made a noticeable difference, at least. Image processing was never my field of study, so for all I know there are more successful and more efficient algorithms to do what I tried to do here... but oh well.
So far, there are only two selectable palettes for step 4: a purely random one, and a very rough "natural" one, which tries to assign sky colours to the upper corners, grass colours to the lower corners, brown (rocks or wood) colours to the middle of each side, and varied colours down the centre. Success has been... limited.

Usage:
usage: paint_by_prog.py [-h] [-p PALETTE] [-t THRESHOLD] [-f | -F] [-d]
                        FILE [FILE ...]

Paint one or more line-art images.

positional arguments:
  FILE                  one or more image filenames

optional arguments:
  -h, --help            show this help message and exit
  -p PALETTE, --palette PALETTE
                        a palette from which to choose colours; one of
                        "random" (the default) or "natural"
  -t THRESHOLD, --threshold THRESHOLD
                        the lightness threshold between outlines and paintable
                        areas (a proportion from 0 to 1)
  -f, --proper-fill     fill under black lines with proper nearest-neighbour
                        searching (slow)
  -F, ---no-proper-fill
                        fill under black lines with approximate nearest-
                        neighbour searching (fast)
  -d, --debug           output debugging information

Samples:
paint_by_prog.py -t 0.7 Gryphon-Lines.png

paint_by_prog.py Dragon-Tattoo-Outline.jpg

paint_by_prog.py -t 0.85 -p natural The-Pumpkin-Farm-of-Good-old-Days.jpg

paint_by_prog.py -t 0.7 Dragon-OutLine.jpg

paint_by_prog.py stejar-arbore-schiţă-natura.png

The chicken doesn't look very good, and my most recent result for the Link image isn't the best; one that came from an earlier version of the code was largely pale yellow, and had an interesting desert vibe about it...

Performance:
Each image takes a couple of seconds to process with default settings, which means an approximate nearest-neighbour algorithm is used for step 5. True nearest-neighbour is significantly slower, taking maybe half a minute (I haven't actually timed it).

The first image looks fantastic, especially that brown eye. Good job. I also applaud you on getting green grass, brown fields of pumpkins and purple clouds.

Java
Random color selection from your choice of pallette.
Warning: Region finding currently very slow, unless the white regions are unusually small.
import java.awt.Color;
import java.awt.image.*;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.function.Supplier;

import javax.imageio.ImageIO;

public class Colorer{
    public static boolean isProbablyWhite(int x,int y){
        Color c=new Color(image.getRGB(x, y));
        if(c.getRed()<240)return false;
        if(c.getBlue()<240)return false;
        if(c.getGreen()<240)return false;
        return true;
    }
    static class Point{
        int x,y;
        public boolean equals(Object o){
            if(o instanceof Point){
                Point p=(Point)o;
                return x==p.x&&y==p.y;
            }
            return false;
        }
        public Point(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
    static BufferedImage image;
    static int W,H;
    public static void check(Point p,List<Point>l1,List<Point>l2,List<Point>l3){
        if(!isProbablyWhite(p.x,p.y))return;
        if(l1.contains(p))return;
        if(l2.contains(p))return;
        if(l3.contains(p))return;
        l1.add(p);
    }
    public static void process(int x,int y,Color c){
        List<Point>plist=new LinkedList<>();
        int rgb=c.getRGB();
        plist.add(new Point(x,y));
        List<Point>l3=new LinkedList<>();
        int k=0;
        for(int i=0;i<W*H;i++){
            System.out.println(k=l3.size());
            List<Point>l2=new LinkedList<>();
            for(Point p:plist){
                int x1=p.x;
                int y1=p.y;
                if(x1>0){
                    check(new Point(x1-1,y1),l2,plist,l3);
                }
                if(y1>0){
                    check(new Point(x1,y1-1),l2,plist,l3);
                }
                if(x1<W-1){
                    check(new Point(x1+1,y1),l2,plist,l3);
                }
                if(y1<H-1){
                    check(new Point(x1,y1+1),l2,plist,l3);
                }
            }
            while(!plist.isEmpty()){
                l3.add(plist.remove(0));
            }
            if(l3.size()==k)break;
            plist=l2;
        }
        plist=l3;
        for(Point p:plist){
            image.setRGB(p.x,p.y,rgb);
        }
    }
    public static void main(String[]args) throws Exception{
        Random rand=new Random();
        List<Supplier<Color>>colgen=new ArrayList<>();
        colgen.add(()->{return new Color(rand.nextInt(20),50+rand.nextInt(200),70+rand.nextInt(180));});
        colgen.add(()->{return new Color(rand.nextInt(20),rand.nextInt(40),70+rand.nextInt(180));});
        colgen.add(()->{return new Color(150+rand.nextInt(90),10+rand.nextInt(120),rand.nextInt(5));});
        colgen.add(()->{int r=rand.nextInt(200);return new Color(r,r,r);});
        colgen.add(()->{return Arrays.asList(new Color(255,0,0),new Color(0,255,0),new Color(0,0,255)).get(rand.nextInt(3));});
        colgen.add(()->{return Arrays.asList(new Color(156,189,15),new Color(140,173,15),new Color(48,98,48),new Color(15,56,15)).get(rand.nextInt(4));});
        Scanner in=new Scanner(System.in);
        image=ImageIO.read(new File(in.nextLine()));
        final Supplier<Color>sup=colgen.get(in.nextInt());
        W=image.getWidth();
        H=image.getHeight();
        for(int x=0;x<W;x++){
            for(int y=0;y<H;y++){
                if(isProbablyWhite(x,y))process(x,y,sup.get());
            }
        }
        ImageIO.write(image,"png",new File("out.png"));
    }
}

Requires two inputs: the filename, and the palette ID. Includes some antialiasing correction, but does not include logic for transparent pixels.
The following palettes are currently recognized:
0: Blue and greeen
1: Blue
2: Red
3: Greyscale
4: Three-color Red, Green, and Blue
5: Classic Game Boy pallette (four shades of green)

Results:
Dragon, Game Boy palette:

The other dragon, blue + green palette:

GOL still life mona lisa (as rendered by this program), tricolor palette:

+1 for your colour customisability! :) if you could fix the antialiasing issue this would look even better. How long did it take you to output these images?