text:
ECHO! Echo! echo. (echo)
Your challenge, should you choose to accept it, is simple:
Implement RFC 862, also known as the Echo Protocol:
The Echo protocol
An echo service simply sends back to the originating source any data it receives.
TCP Based Echo Service
One echo service is defined as a connection based application on TCP. A server listens for TCP connections on TCP port 7.  Once a connection is established any data received is sent back.  This continues until the calling user terminates the connection.
UDP Based Echo Service
Another echo service is defined as a datagram based application on UDP.  A server listens for UDP datagrams on UDP port 7.  When a datagram is received, the data from it is sent back in an answering datagram.
Scoring

The score is one point for every byte of code as encoded in UTF-8 or a language-specific code page, whichever is smaller.
If the program incompletely implements RFC 862 by providing only UDP or only TCP, the score is doubled.
If the program incorrectly implements RFC 862 by either using a port other than 7 or by dropping or transforming certain bytes due to language limitations or corner cutting, the score is quadrupled. (This stacks with the preceding point if applicable.)
If the program is invalid, the score is ω.

Rules
A valid program:

Does not use standard loopholes.
Per connection:

Accepts connections and receive incoming data.
Sends outgoing data in an amount that is always less than or equal to the amount of data received.

Does not invoke programs external to itself. (Spawning children to deal with multiple connections is fine, spinning up inetd or its local equivalent is not.)
Does not use library functions specifically designed to start and maintain an echo service.

This is code golf, so lowest score wins.

We require challenges to be self-contained, at the moment we have to read external resources to determine what we are supposed to do. Voting to close as unclear until you fix that.

@DenkerAffe: Addressed.

AKA: HTTP Cat program.

Does not use library functions specifically designed to start and maintain an echo service? What? Seriously?

@epicTCK I'm not sure I understand your objection.

Infinity is ∞, not ω

@anatolyg ∞ isn't a number, ω is; and the score needs to be a number.

Why don't you just say if the program is invalid it's disqualified..

I think the rule about port 7 is pointless.  In general, you'll need to be root to use ports <1024, regardless of language.  I assume that this challenge is allowing entries to run as root with no extra penalty.

@DigitalTrauma, byte count. 7 is one byte.

@DigitalTrauma, it's better to use fixed one-digit port as it voildn't affect program length.

@Qwertiy which should be fine for just about any language that has a bind() equivalent, which I assume will be just about every entry.  It just seemed a bit strange to explicitly state this as a rule (with such a harsh penalty)

These penalties are ridiculous. If you want to require supporting both TCP and UDP, then just require it. With these harsh penalties, it's essentially required anyway in order to have a good score.

Why do you have the encoding rules? They seem pointless.

IPv4 or IPv6 protocols? Assuming IPv4.

I think at the core it's a fine challenge but the scoring is nonsensical. Typically either a solution is valid or it isn't; we don't really allow "almost correct" solutions in general. Also, the UTF-8 thing seems unnecessary to specify since by default we allow answers to be scored in bytes of whichever encoding is most natural. I recommend posting challenge ideas to the Sandbox where they can get feedback prior to going live.

JavaScript (Node.js) 102 Bytes (51 * 2)
require("net").createServer(s=>s.pipe(s)).listen(7)

You can add UDP for a total of 132 bytes, as seen below:
require("net").createServer(s=>s.pipe(s)).listen(7),(u=require("dgram").createSocket("udp4")).on("message",msg=>u.send(msg)).bind(7)

Was tested on node.js v5.2.0
Make sure to run with sudo on Unix descendants (OS X, Linux, etc.)

Python, 299 295 265 263
from threading import*
from socket import*
a='',7;S=socket
u=S(2,2);u.bind(a)
def U():
 while 1:u.sendto(*u.recvfrom(4**8))
Thread(None,U).start()
def C(c,x):
 while c.send(c.recv(1)):1
s=S(2,1);s.bind(a);s.listen(1)
while 1:Thread(None,C,args=s.accept()).start()

handles both udp and tcp.
@MorganThrapp helped saving 33 (!) chars

You can also get rid of the parens on ('',7). Also, move s=S(2,2);s.bind(a) out of U to save another byte.

A UDP datagram may have up to 65,507 bytes, so 999 is not enough; I suggest 4**8.

well, afaik in practice the max size for udp packets is more around 500 bytes ..

No, in practice it’s 1472 for non-fragmented datagrams (1500 ethernet MTU − 20 byte IP header − 8 byte UDP header), but fragmented datagrams or jumbograms can be larger.

@Anders Karseorg And much more if you use https://en.wikipedia.org/wiki/IP_over_Avian_Carriers   :)   -   anyway I put 4**8 and you give me an upvote, ok ?

Also consider replacing while 1:c.send(c.recv(1)) with while c.send(c.recv(1)):1 to handle closed TCP connections without spinning forever.

Racket, 231
(thread(λ()(do([l(tcp-listen 7)])(#f)(let-values([(i o)(tcp-accept l)])(copy-port i o)))))((λ(s b)(udp-bind! s #f 7)(do()(#f)(let-values([(n h p)(udp-receive! s b)])(udp-send-to s h p b 0 n))))(udp-open-socket)(make-bytes 65535))

TCP and UDP.
The TCP echo server uses a handy Racket procedure named copy-port that copies ports in the background, managed by Racket, instead of by the programmer. That also means I don't have to spin off a thread for each client, only for the listener (so I can start the UDP listener on the main thread).


text:
Exploded substrings
Introduction
Let's observe the string abc. The substrings that can be made from this are:
a, ab, abc, b, bc, c

We now need to align them under the initial string, like this:
abc
a
 b
  c
ab
 bc
abc

The order of the string doesn't matter, so this is also perfectly valid:
abc
a
ab
abc
 b
 bc
  c

So, the substring is positioned under the location of the substring in the initial string. So for abcdef and the substring cde, it would look like this:
abcdef
  cde

The Task
The task is to align all substrings with a length greater than 0, like shown above. You can assume that the string itself will only contain alphabetic characters and has at least 1 character. For the padding, you can use a space or some other non-alphabetic printable ASCII character (32 - 127). Maybe not necessary to mention, but the string itself will only contain unique characters, so not like aba, since the a occurs twice.
Test cases
Input: abcde
Possible output:
a
ab
abc
abcd
abcde
 b
 bc
 bcd
 bcde
  c
  cd
  cde
   d
   de
    e

Input: abcdefghij
Possible output:
a
ab
abc
abcd
abcde
abcdef
abcdefg
abcdefgh
abcdefghi
abcdefghij
 b
 bc
 bcd
 bcde
 bcdef
 bcdefg
 bcdefgh
 bcdefghi
 bcdefghij
  c
  cd
  cde
  cdef
  cdefg
  cdefgh
  cdefghi
  cdefghij
   d
   de
   def
   defg
   defgh
   defghi
   defghij
    e
    ef
    efg
    efgh
    efghi
    efghij
     f
     fg
     fgh
     fghi
     fghij
      g
      gh
      ghi
      ghij
       h
       hi
       hij
        i
        ij
         j

This is code-golf, so the submission with the least amount of bytes wins!

Where is the empty substring?

@KennyLau Oh yes, that reminds me to edit some more info into the challenge.

Is a trailing newline acceptable?

@user81655 Yes, that's acceptable.

Is an array of strings acceptable, or does it have to be newline-separated?

Must there also be padding after the substring ? e.g. is ab\na\n-b\n allowed for ab

Does the character with ASCII code 255 count as printable ?

@Zgarb An array of strings is also acceptable.

@TonHospel No, padding after the substring is not necessary. Also, with printable ASCII, I meant ASCII characters in the range 32 - 127. I'll edit that into the challenge.

Would a set of strings be OK for the output?

@xnor You mean like ["ab", " b", "a"]? That's fine. They have to be padded with spaces at the left though.

@Adnan I meant like {"ab", " b", "a"} in Python, where set is a built-in data type that is unordered and enforces uniqueness.

@xnor Oh, that is fine. The uniqueness also doesn't matter because the input string itself will always contain unique characters (e.g. not aba).

Is it okay if the lines are padded on both sides instead of just the left?

@Cyoce As long as the same letters are in the same row.

Pyth, 14 13 10 bytes
Thanks to @FryAmTheEggman for saving 3 bytes.
jmXQ-Qd;.:

Try it online!

@LuisMendo Done.

jmXQ-Qd;.: Similar idea, using X.

Perl, 32 28 24 bytes
Includes +1 for -n
Code:
/.+(??{say$"x"@-".$&})/

Run with the string on STDIN:
perl -nE '/.+(??{say$"x"@-".$&})/' <<< abcd

The golfing languages are so close and yet so far away...
Explanation
/.+/ matches a substring. Unfortunately it stops once it matched one. So I use the runtime regex construct (??{}) to extend the regex so it fails and backtracking will try the following substring, in the end trying them all before giving up in disgust.
Inside the (??{}) I print the current substring prefixed by as many spaces as the offset of the substring using $"x"@-"
So the output neatly documents how regex backtracking works:
abcd
abc
ab
a
 bcd
 bc
 b
  cd
  c
   d

Good gravy, this is just as esoteric looking as the esolangs. Have a +1.

@TimmyD: For some strange reason there are people who say golfing gives Perl a bad name...

The Perl 6 version that was inspired from this is very similar functionally perl6 -ne 'm/^(.*)(.+)<{+put " "x$0.to,$1}>/'

Doesn't work on input ab1 (I assume because say... evaluates to 1). (Tested in 5.18.2.) Edit: Oh! sorry, the question says "You can assume that the string itself will only contain alphabetic characters".

MATL, 20 18 bytes
Inspired by the pattern of substrings generated by @aditsu's answer
tt!+gR*c`t3Lt3$)tn

Try it online!
The pattern of substrings is generated by an upper triangular matrix the same size as the input, and all submatrices obtained by successively removing the last row and column.
Explanation
t         % implicit input. Duplicate
t!+g      % square matrix with size as input
R         % keep upper triangular part
*c        % multiply element-wise with broadcast. Convert to char
`         % do...while
  t       %   duplicate
  3Lt3$)  %   remove last row and column
  tn      %   number of remaining elements. Used as loop condition
          % implicitly end loop and display

Old approach (Cartesian power)
I'm keeping this approach in case it serves as inspiration for other answers
tn0:2Z^!S!2\Xu4LY)*c

In the online compiler this runs out of memory for the longest test case.
Try it online!
Explanation
This generates all patterns of values 0, 1 and 2 in increasing order, and then transforms 2 into 0. This gives all possible patterns of 0 and 1 where the 1 values are contiguous. These are used to mark which characters are taken from the original string.
As an example, for string 'abc' the patterns are generated as follows. First the Cartesian power of [0 1 2] raised to the number of input characters is obtained:
0 0 0
0 0 1
0 0 2
0 1 0
0 1 1
···
2 2 1
2 2 2

Sorting each row gives
0 0 0
0 0 1
0 0 2
0 0 1
0 1 1
···
1 2 2
2 2 2

Transforming 2 into 0 (i.e. mod(...,2)) and removing duplicate rows gives the final pattern
0 0 0
0 0 1
0 1 1
0 1 0
1 1 1
1 1 0
1 0 0

in which each row is a mask corresponding to a (contiguous) substring. The first row needs to be removed because it corresponds to the empty substring.
t      % Implicitly get input. Duplicate
n      % Number of elements
0:2    % Vector [0 1 2]
Z^     % Cartesian power. Each result is a row
!S!    % Sort each row
2\     % Modulo 2: transform 2 into 0
Xu     % Unique rows
4LY)   % Remove first (corresponds to the empty substring)
*      % Element-wise multiplication by original string
c      % Convert to char. Implicitly display

Is your mind one big matrix-manipulation machine?

@cat Too many years of Matlab use I guess :-)

Retina, 48 32 31 bytes
Thanks to Kenny Lau for saving 3 bytes and paving the way for many more.
Byte count assumes ISO 8859-1 encoding.
M&!r`.+
%+`( *)\S(.+)$
$&¶$1 $2

Try it online!
Order of the generated substrings:
abcde
 bcde
  cde
   de
    e
abcd
 bcd
  cd
   d
abc
 bc
  c
ab
 b
a

Explanation
M&!r`.+

This gets us all the prefixes of the input. This is done by matching (M) any substring (.+) starting from the end (r), considering overlapping matches (&) and returning all of those matches joined with linefeeds (!).
Now all we need to do is carve out the successive prefixes of those prefixes (by replacing them with spaces). We do this step by step with a loop:
%+`( *)\S(.+)$
$&¶$1 $2

The % means that this entire thing is done to each line individually (considering it a separate string for time being, and joining it all back together with linefeeds at the end). The + tells Retina to run this substitution in a loop until the output stops changing (which in this case means that the regex no longer matches). The regex then tries to match the last line of the input with at least two non-space characters, and appends a new row where the first of those is replaced with a space.

Can we have ! implies M and 1char versions of .+ and .*?

Also prefixes of prefixes of a string=prefixes of a string. Maybe you meant prefixes of suffixes? (Edited to correct.)

@CatsAreFluffy No the explanation was correct. When we remove prefixes from prefixes, we get substrings. As for the other suggestions, I don't think I'll make options imply stages. While currently, a lot characters are used only for one stage type, that will probably change in the future. As for .+ and .* I'd have to tokenise the regex, and while I'm planning to do that at some point, I don't think it's gonna happen any time soon (and if I do, I'll probably focus on features that actually add expressiveness).

1 byte saved

Oracle SQL 11.2, 146 bytes
WITH v AS(SELECT LEVEL i FROM DUAL CONNECT BY LEVEL<=LENGTH(:1))SELECT LPAD(SUBSTR(:1,s.i,l.i),s.i+l.i-1)FROM v s,v l WHERE s.i+l.i<=LENGTH(:1)+1;

Un-golfed
WITH v AS(SELECT LEVEL i FROM DUAL CONNECT BY LEVEL<=LENGTH(:1))
SELECT LPAD(SUBSTR(:1,s.i,l.i),s.i+l.i-1)
FROM   v s, v l
WHERE  s.i+l.i<=LENGTH(:1)+1

CJam, 20
q{__,{\_N+oSt}/;W<}h

Try it online
Explanation:
q           read the input (initial string)
{…}h        do … while
  _         copy the current string
  _,        copy and get the length
  {…}/      for each value (say i) from 0 to length-1
    \       bring the string to the top
    _N+o    make a copy, append a newline and print
    St      set the i'th element to S=" "
  ;         pop the last result (array full of spaces)
  W<        remove the last character of the current string
             if the string is empty, the do-while loop terminates

Python, 57 bytes
f=lambda s,p='':set(s)and{p+s}|f(s[1:],' '+p)|f(s[:-1],p)

Outputs a set like {' b', 'a', 'ab'}. The idea is to recurse down two branched that cut off the first or last character. The gives redundant outputs, but the set automatically removes duplicates. For alignment, every time the first character is cut off, a space is added to the prefix p, which is concatenated onto the front.

C#, 136 132 131 bytes

Golfed
String m(String s){String o="",e=o;for(int i=0,a,l=s.Length;i<l;i++,e+=" ")for(a=1;a+i<=l;a++)o+=e+s.Substring(i,a)+"\n";return o;}

Ungolfed
String m( String s ) {
    String o = "", e = o;

    for (int i = 0, a, l = s.Length; i < l; i++, e += " ")
        for (a = 1; a + i <= l; a++)
            o += e + s.Substring( i, a ) + "\n";

    return o;
}

Full code
    using System;
using System.Collections.Generic;

namespace Namespace {
    class Program {
        static void Main( string[] args ) {
            List<String> ls = new List<String>() {
                    "abcde",
                    "abcdefghijklmnop",
                    "0123456789",
                };

            foreach (String s in ls) {
                Console.WriteLine( s );
                Console.WriteLine( m( s ) );
                Console.WriteLine( "" );
            }

            Console.ReadLine();
        }

        static String m( String s ) {
            String o = "", e = o;

            for (int i = 0, a, l = s.Length; i < l; i++, e += " ")
                for (a = 1; a + i <= l; a++)
                    o += e + s.Substring( i, a ) + "\n";

            return o;
        }
    }
}

Releases

v1.2 - -1 byte - Changed the String o="",e=""; to String o="",e=o; to save 1 byte. The idea was from Gallant ( I forgot to apply this part in the last update, I apologize. ).
v1.1 -  -4 bytes - Droped the brackets from the for loops and moved the e var space increment to the iterator zone of the outer for loop. The idea was from Gallant.
v1.0 - 136 bytes - Initial solution.

You can drop the curly braces on the inner loop and assign e=o to save 3 bytes.

can also swap String o="",... with var o... for another 3.

@tycobb it would render useless convert String o = "", e = ""; to var since I would have to separate them into two, resulting in var o = ""; var e = ""; which is the same length compared with the one I have. Would do it, but VS doesn't allow multiple variable declaration when using implicitly-typed variables - a.k.a. var's. But thanks for the help.
EDIT: Having VS shouting me that I can't do it, I'm assuming it's incorrect, may be wrong.

PowerShell v2+, 69 bytes
param($a)0..($b=$a.length-1)|%{($i=$_)..$b|%{" "*$i+-join$a[$i..$_]}}

Takes input $a, loops over the length (setting $b in the process for use later). Each outer loop, we loop up to $b again, setting $i for use later. Each inner loop, we output $i number of spaces concatenated with a slice of the input string. Since we're just looping through the string, this will actually handle any arbitrary string (duplicate letters, spaces, whatever).
Example
PS C:\Tools\Scripts\golfing> .\exploded-substrings.ps1 "Golfing"
G
Go
Gol
Golf
Golfi
Golfin
Golfing
 o
 ol
 olf
 olfi
 olfin
 olfing
  l
  lf
  lfi
  lfin
  lfing
   f
   fi
   fin
   fing
    i
    in
    ing
     n
     ng
      g

Python 2.7, 70 82 bytes
I couldn't figure out how to get it on 1 line. Call with e("abcde",0)
def e(s,p):
 f=len(s)
 for x in range(f):print(' '*p+s[:x+1])
 if f>1:e(s[1:],p+1)

Python 3, 80 78 bytes
Loop through the number of spaces to prefix with and then the number of characters to end with.
lambda x:[print(' '*i+x[i:j+1])for i in range(len(x))for j in range(i,len(x))]

Edit: Removed spaces before the for loops.

MATL, 15 14 bytes
Saved one byte due to @LuisMendo's tip here!
tfWt2/!-RXzB*c

So many ways... had to find a new one. Happy bits! :)
Try it online!
Exploded
t       % duplicate input
f       % get indices of nonzero elements in vector (i.e. 1:n)
W       % 2 raised to array, element-wise: 2^(1:n)
t       % duplicate array
2/      % divide by 2: 2^(0:n-1)
!       % transpose array
-       % element-wise subtraction (w/singleton expansion)
R       % upper triangular part
Xz      % nonzero elements
B       % convert from decimal to binary. Produces a logical array
*       % array product (element-wise, singleton expansion)
c       % convert to character array; 0's automatically converted to spaces

JavaScript (ES6), 89 bytes

document.write("<pre>"+(

s=>(a=[...s]).map((_,i)=>a.map((_,j)=>++j>i?r+=" ".repeat(i)+s.slice(i,j)+`
`:0),r="")&&r

)("abcde"))

Straight-forward approach. Output has a trailing newline.

What does => mean in Javascript ? Is it a binary operator

@EwanDelanoy It declares an ES6 Arrow Function.

Pyth, 12 11 bytes
jm+*;xQdd.:

Sadly the question allows us to assume unique characters, so I just lookup the first position of the substring, and pad with spaces.

You can use ; instead of \  when inside the lowest level map.

JavaScript (ES6), 72
s=>{for(i=j=0;s[j]||s[j=++i];)console.log(' '.repeat(i)+s.slice(i,++j))}

JavaScript (Firefox 30-57), 65 63 bytes
s=>[for(c of(i=0,s))for(d of(t=r=i?t+' ':'',s.slice(i++)))r+=d]

Returns an array of strings. As ES6 it's 78 bytes:
s=>[...s].map((_,i,a)=>a.slice(i).map(c=>r.push(u+=c),t=u=i?t+' ':''),r=[])&&r

Mathematica 89 bytes
r@i_:=StringReplace[i,#->" "]&/@(Complement[y,#]&/@Subsequences[y=Characters@i])//Column

Explanation
i refers to the input string
Subsequences[y=Characters@i] returns all subsequences (represented lists of characters) of the input. (Subsequences was introduced in v. 10.4)
For each subsequence, Complement... returns those characters from the input string that are not present.  Each of those characters is replaced by an empty space via StringReplace[i,#->" "].
Column displays the results in a single column. Each output string has the same number of characters, resulting in aligned letters.

r@"abcdefgh"

By 10.0.4 you mean 10.4, right? 10.3 doesn't have it.

Yes. 10.4  I'll correct it.

J, 32 29 28 bytes
(-@{.@i.|.])"1 a:>@-.~&,<\\.

This evaluates to a monadic verb. Try it here. Usage:
   f =: (-@{.@i.|.])"1 a:>@-.~&,<\\.
   f 'abe'
a
ab
abe
 b
 be
  e

Explanation
As some other answers, I compute the index of occurrence of the first character of each substring.
The substrings are stored in a matrix with trailing spaces, so I rotate them to the right by their index to get the right amount of padding.
That one piece of whitespace between "1 and a: is really annoying...
(-@{.@i.|.])"1 a:>@-.~&,<\\.  Input is y
                        <\\.  Compute suffixes of prefixes of y, and put them in boxes.
                              This gives a 2D array of substrings in boxes.
                      &,      Flatten the array of boxes,
               a:  -.~        remove all empty strings, and
                 >@           open each box. This places the strings in a 2D matrix of
                              characters, with trailing spaces to make it rectangular.
(          )"1                Do this for each line x in the matrix:
      i.                        The index of every character of x in y.
 -@{.@                          Take the first one and negate it.
        |.]                     Rotate x to the left by that amount.
                                Since we negated the index, this rotates to the right.

a e is not a substring as defined by the challenge

@TonHospel I fixed the program, it now follows the spec.

QBasic, 75 bytes
INPUT s$
FOR i=1TO LEN(s$)
FOR j=1TO i
LOCATE,j
?MID$(s$,j,i+1-j)
NEXT
NEXT

The basic double-FOR-loop strategy, modified a bit for QBasic's 1-based indexing. The main trick is LOCATE,j, which moves the cursor over to column j of the current line before printing. Since column 1 is the first column, this is equivalent to printing j-1 leading spaces.

Perl 6, 34 bytes
perl6 -ne 'm/^(.*)(.+)<{+put " "x$0.to,$1}>/'

m/       # match the input line
  ^      # from the start
  ( .* ) # 0 or more characters ( $0 )
  ( .+ ) # 1 or more characters ( $1 )

  <{ # match against the result of:

    +put # print with a trailing newline:
      " " x $0.to, # add the leading spaces
      $1           # the substring
  }>
/

The reason for the + before put is so that it returns 1 instead of True, which is guaranteed not to be in the input so it always has to backtrack.
$ perl6 -ne 'm/^(.*)(.+)<{+put " "x$0.to,$1}>/' <<< abcd

   d
  cd
  c
 bcd
 bc
 b
abcd
abc
ab
a

( If you want it in the opposite order use (.*?)(.+?) instead of (.*)(.+) )
This was inspired by the Perl 5 answer.

J, 35 23 22 bytes
[:;#\.<@{."_1|.\."1^:2

It took me a while but I finally optimized it.
Usage
   f =: [:;#\.<@{."_1|.\."1^:2
   f 'abcde'
abcde
abcd
abc
ab
a
 bcde
 bcd
 bc
 b
  cde
  cd
  c
   de
   d
    e

Explanation
[:;#\.<@{."_1|.\."1^:2  Input: s
             |.\."1     For each suffix of s, reverse it
                   ^:2  Repeat that twice to create all exploded substrings
   #\.                  Get the length of each suffix. This is
                        used to make the range [len(s), len(s)-1, ..., 1]
        {."_1           For each value in the range, take that many strings from
                        the list of exploded substrings. This avoids blank substrings
      <@                Box each set of strings
[:;                     Unbox and join the strings together and return

You can save 2 bytes by removing the right pair of parentheses. Also, doing [:+./"1' '~:] instead of [:-.[:*/"1' '=] saves another 2 bytes.

Java, 138 bytes
String e(String s){int l=s.length(),a=0,i,j;for(;++a<l;)for(i=0;i<=l-a;){s+="\n";for(j=0;j++<i;)s+=" ";s+=s.substring(i,i+++a);}return s;}

Formatted:
String e(String s) {
    int l = s.length(), a = 0, i, j;
    for (; ++a < l;)
        for (i = 0; i <= l - a;) {
            s += "\n";
            for (j = 0; j++ < i;)
                s += " ";
            s += s.substring(i, i++ + a);
        }
    return s;
}

Pyke, 15 bytes
QlFUQRd:DlRF2h<

Try it here!
Assumes array of padded strings is acceptable
Pads first and then chops.

Haskell, 65 bytes
(>>=zipWith((++).(`replicate`' '))[0..].init.tails).reverse.inits

It requires inits and tails from Data.List, though. To output it, add mapM_ putStrLn. to the front.
Relatively straightforward; the reverse is to make sure the original string is first.
GHCi> mapM_ putStrLn.(>>=zipWith((++).(`replicate`' '))[0..].init.tails).reverse.inits$"abcde"
abcde
 bcde
  cde
   de
    e
abcd
 bcd
  cd
   d
abc
 bc
  c
ab
 b
a
it :: ()
(0.02 secs, 0 bytes)

(>>=zipWith(++)(inits$cycle" ").init.tails).inits. And please add the import Data.List; to the byte count.

Ruby, 75 67 bytes
Anonymous function. Uses regex substitution to align the substrings. . is the filler character.
->s{(l=s.size).times{|i|(l-i).times{|j|puts s.tr(?^+s[j,i+1],?.)}}}

bash + GNU coreutils, 109 Bytes
l=${#1}
for i in `seq 0 $l`;{
for j in `seq $((l-i))`;{
for k in `seq $i`;{ printf ' ';}
echo ${1:i:j}
}; }

Maybe there is a shorter solution, but this is the best that came into my mind. Uniqueness of chracters does not matter here.

PHP, 151 chars
Ungolfed
<?php
$input = $argv[1];
foreach(str_split($input) as $p=>$letter)
{
    $spaces = str_repeat(" ", $p);
    echo $spaces.$letter."\n";
    $p++;
    for($i=$p;$i<strlen($input);$i++)
    {
        echo $spaces.$letter.substr($input, $p, $i)."\n";
    }
}
?>

Golfed
<?$c=$argv[1];foreach(str_split($c)as$d=>$b){$a=str_repeat(" ",$d);echo$a.$b."\n";$d++;for($e=$d;$e<strlen($c);$e++){echo$a.$b.substr($c,$d,$e)."\n";}}

Example
php explodesub.php 'abc'
a
ab
abc
 b
 bc
  c

C++, 145 Bytes
the first start parameter is used as input, console as output
#include<iostream>
#define f(y,b,d) for(int y=b;r[0][y];y++){d;}
int main(int,char*r[]){f(x,0,f(y,x+1,std::cout.write(r[0],y)<<'\n')r[0][x]=32)}

Great answer and welcome to PPCG! I don't use C++ much but can't you do std::cout<<r[0]<<y<<'\n' instead of `std::cout.write(r[0],y)<<'\n'? Can you please add a brief explanation? Thanks!

Python 2 (Ungolfed) 99 Bytes
t=raw_input()
l=len(t)
for j in range(l):
 for i in range(l):
  if i>=j:print j*' '+t[j:i+1]

Result:
>>python codegolf.py
abc
a
ab
abc
 b
 bc
  c

>>python codegolf.py
abcdef
a
ab
abc
abcd
abcde
abcdef
 b
 bc
 bcd
 bcde
 bcdef
  c
  cd
  cde
  cdef
   d
   de
   def
    e
    ef
     f

>>python codegolf.py
lmnopqrst
l
lm
lmn
lmno
lmnop
lmnopq
lmnopqr
lmnopqrs
lmnopqrst
 m
 mn
 mno
 mnop
 mnopq
 mnopqr
 mnopqrs
 mnopqrst
  n
  no
  nop
  nopq
  nopqr
  nopqrs
  nopqrst
   o
   op
   opq
   opqr
   opqrs
   opqrst
    p
    pq
    pqr
    pqrs
    pqrst
     q
     qr
     qrs
     qrst
      r
      rs
      rst
       s
       st
        t

source: Stack Exchange

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

sort: votes


text:
Symme-Try This Triangle Trial
A string whose length is a positive triangular number (1, 3, 6, 10, 15...) can be arranged into an "equilateral text triangle" by adding some spaces and newlines (and keeping it in the same reading order).
For example, the length 10 string ABCDEFGHIJ becomes:
   A
  B C
 D E F
G H I J

Write a program or function that takes in such a string, except it will only contains the characters 0 and 1. (You may assume the input is valid.)
For the resulting "equilateral text triangle", output (print or return) one of four numbers that denotes the type of symmetry exhibited:

Output 2 if the triangle has bilateral symmetry. i.e. it has a line of symmetry from any one corner to the opposite side's midpoint.
Examples:
 0
1 1

 1
0 1

  0
 0 1
0 1 0

   1
  1 1
 1 0 1
0 1 1 1

Output 3 if the triangle has rotational symmetry. i.e. it could be rotated 120° with no visual change.
Examples:
   0
  1 0
 0 1 1
0 1 0 0

   0
  0 1
 1 0 0
0 0 1 0

    1
   0 1
  1 1 1
 1 1 1 0
1 0 1 1 1

     1
    0 1
   0 0 1
  1 0 0 0
 1 0 0 0 0
1 0 0 1 1 1

Output 6 if the triangle has both bilateral and rotational symmetry. i.e. it matches the conditions for outputting both 2 and 3.
Examples:
0

1

 0
0 0

  1
 0 0
1 0 1

   0
  0 0
 0 1 0
0 0 0 0

Output 1 if the triangle has neither bilateral nor rotational symmetry.
Examples:
  1
 1 0
0 0 0

  0
 0 1
1 0 1

   1
  1 0
 1 1 1
1 1 1 1

    1
   1 1
  1 1 1
 0 0 0 1
1 1 1 1 1

The shortest code in bytes wins. Tiebreaker is earlier answer.
Aside from an optional trailing newline, the input string may not have space/newline padding or structure - it should be plain 0's and 1's.
If desired you may use any two distinct printable ASCII characters in place of 0 and 1.
Test Cases
Taken direct from examples.
011 -> 2
101 -> 2
001010 -> 2
1111010111 -> 2
0100110100 -> 3
0011000010 -> 3
101111111010111 -> 3
101001100010000100111 -> 3
0 -> 6
1 -> 6
000 -> 6
100101 -> 6
0000100000 -> 6
110000 -> 1
001101 -> 1
1101111111 -> 1
111111000111111 -> 1

"Rotating" any input by 120° will of course result in the same output.

That title is just painful......

@EᴀsᴛᴇʀʟʏIʀᴋ Just tri to ignore it.

@HelkaHomba Why... why...

CJam, 37 29 28 27 bytes
Thanks to Sp3000 for saving 3 bytes.
q{T):T/(\s}h]{z_Wf%_}3*])e=

Test suite.
This reuses some triangle rotation tricks from this challenge.
This also works for the same byte count:
q{T):T/(\s}h]3{;z_Wf%_}%)e=

Explanation
First, a quick recap from the triangle post I linked to above. We represent a triangle as a 2D (ragged) list, e.g.
[[0 1 1]
 [0 0]
 [0]]

The symmetry group of the triangle has 6 elements. There are cycles of length 3 by rotating the triangle and cycles of 2 by mirroring it along some axis. Conveniently, the rotations correspond to perform to two different reflections. We will use the following reflections to do this:

Transpose the list means reflecting it along the main diagonal, so we'd get:
[[0 0 0]
 [1 0]
 [1]]

Reversing each row represents a reflection which swaps the top two corners. Applying this to the result of the transposition we get:
[[0 0 0]
 [0 1]
 [1]]

Using these two transformations, and keeping the intermediate result, we can generate all six symmetries of the input.
A further point of note is the behaviour of transposition on a list like this:
[[0]
 [1 0]
 [1 0 0]
 []]

Because that's what we'll end up with after splitting up the input. Conveniently, after transposing, CJam flushes all lines to the left, which means this actually gets rid of the extraneous [] and brings it into a form that's useful for the above two transformations (all without changing the actual layout of the triangle beyond reflectional symmetry):
[[0 1 1]
 [0 0]
 [0]]

With that out of the way, here's the code:
q       e# Read input.
{       e# While the input string isn't empty yet...
  T):T  e#   Increment T (initially 0) and store it back in T.
  /     e#   Split input into chunks of that size.
  (     e#   Pull off the first chunk.
  \s    e#   Swap with remaining chunks and join them back together
        e#   into a single string.
}h
]       e# The stack now has chunks of increasing length and an empty string
        e# as I mentioned above. Wrap all of that in an array.
{       e# Execute this block 3 times...
  z_    e#   Transpose and duplicate. Remember that on the first iteration
        e#   this gets us a triangle of the desired form and on subsequent
        e#   iterations it adds one additional symmetry to the stack.
  Wf%_  e#   Reverse each row and duplicate.
}3*
        e# The stack now has all 6 symmetries as well as a copy of the
        e# last symmetry.
]       e# Wrap all of them in a list.
)       e# Pull off the copy of the last symmetry.
e=      e# Count how often it appears in the list of symmetries.

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


text:
QWERTY Quine Creation
Challenge
Create a quine, that instead of outputting it's source, output's it's source QWERTY-sorted.
What is QWERTY sorting?
QWERTY sorting is sorting code by the QWERTY keyboard. Anything higher or more left is greater (q > Q, \ > /) with presedence on higher. To check, find the locations of the two characters to compare. Find which character occurs first in the following table (left to right, up to down). The first character is the smaller one.
qwertyuiop[]\
asdfghjkl;'
zxcvbnm,./
QWERTYUIOP{}|
ASDFGHJKL:"
ZXCVBNM<>?
1234567890-=!@#$%^&*()_+~`

(there is a trailing space and linefeed)
Examples:
Code Golf -> eoodflGC
Programming -> rroiagnmmP

(note trailing space on Code Golf)
Specifications

Only characters in the above list are allowed in the source code!
This is code-golf.
Only Proper Quines are allowed (adapted to QWERTY sort).
Output must be in increasing QWERTY order.

You should make explicit that proper quines are required.

:D Jelly can't win this, it is mostly non-ascii!!!

Javascript is clearly winning this. In what else language can you print out a function source code in default?

I've voted to close this question, as I can't understand what is the challenge at all.

@ΈρικΚωνσταντόπουλος What part don't you understand? It reads pretty clear to me.

@Bálint you don't need that feature to win.

Why is f > G > l? The keyboard diagram implies that all lowercase comes before all uppercase, but these examples imply that the upper and lower cases of a letter are right next to each other, i.e. qQwWeE... is sorted.

Possible duplicate of Print every character your program doesn't have

"Anything higher or more left is greater" - This is somewhat ambiguous, what about w and a? w is above a but also to the right of it? I think you need to say which takes precedence.

@MorganThrapp It's not clear enough for everyone to understand.

@ΈρικΚωνσταντόπουλος Okay, but can you point out some specific parts that you find unclear so that NoOne can fix them? There's nothing wrong with finding something unclear, we're all just trying to make the challenges the best we can.

I've VTC this as unclear for the reasons that algorithmshark and FryAmTheEggman pointed out -- the natural expectation of the sentence structure, plus the qwerty diagram, plus the seemingly incongruent examples, don't lead to a solid spec.

@TimmyD Thanks, yeah, looking at those I see now what the issue is. I was honestly just confused.

With that said, I might also be not understanding what this adds beyond a normal quine. To use the Ruby example from Martin's linked "Proper Quine" post, something like _="_=%p;puts _%%_";puts _%_ with the string literal sorted by hand would seem to fit the requirements, so that would mean that plenty of quines can be transferred here with minimal adjustment.

I can't vote to close this again, 'cause "I've alerady voted".

CJam, 25 23 bytes
{`"_~"+{"#$_+~`"`#}$}_~

Thanks to @MartinBüttner for golfing off 2 bytes!
Try it online!
How it works
{                   }_~  Define, copy and execute a code block.

   `                       Create a string representation of the code block.
  "_~"+                    Append that string.
       {          }$       Sort the characters by the following:
        "#$_+~`"`#           Compute the 0-based index of the character in that
                             string. Returns -1 if not found.
                           Since `$' is stable, all characters with tied index -1
                           will appear at the beginning, in their original order.
                           This places {{}} at the beginning, followed by
                           """"##$$___++~~~```.


text:
How compatible are my strings?
Introduction
Consider two strings A and B of the same length L, and an integer K ≥ 0.
For the purposes of this challenge, we say that the strings are K-compatible, if there exists a string C of length K such that A is a contiguous substring of the concatenation BCB.
Note that A is a substring of BAB, so A and B are always L-compatible (but may also be K-compatible for some other K < L).
Input
Your inputs are two strings of the same positive length, consisting of upper- and lowercase ASCII letters.
Output
Your output shall be the lowest non-negative integer K such that the inputs are K-compatible.
Example
Consider the inputs
A = HHHHHH
B = HHttHH

They are not 0-compatible, because A is not a substring of HHttHHHHttHH.
They are also not 1-compatible, because A is not a substring of HHttHH#HHttHH no matter which letter is placed on the #.
However, A is a substring of HHttHHHHHHttHH, where C is the two-letter string HH.
Thus the inputs are 2-compatible, and the correct output is 2.
Rules and scoring
You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
Test cases
The compatibility condition is symmetric, so swapping the two inputs should not change the output.
E G -> 1
E E -> 0
aB Bc -> 1
YY tY -> 1
abcd bcda -> 0
abcXd bxcda -> 4
Hello Hello -> 0
Hello olHel -> 1
aBaXYa aXYaBa -> 1
aXYaBa aBaXYa -> 1
HHHHHH HHttHH -> 2
abcdab cdabcd -> 2
XRRXXXXR XRXXRXXR -> 4
evveeetev tetevevev -> 7
vzzvzJvJJz vJJvzJJvJz -> 10
JJfcfJJcfJfb JcfJfbbJJJfJ -> 5
GhhaaHHbbhGGH HHaaHHbbGGGhh -> 9
OyDGqyDGDOGOGyG yDGqOGqDyyyyOyD -> 12
ffKKBBpGfGKpfGpbKb fGpbKbpBBBffbbbffK -> 9
UZuPPZuPdVdtuDdDiuddUPtUidtVVV dtUPtUidtVVVtDZbZZPuiUZuPPZuPd -> 21

Leaderboard
Here's a Stack Snippet to generate a leaderboard and list of winners by language.
To make sure your answer shows up, start it with a header of the form
## Language, N bytes

You can keep old scores in the header by using the strikethrough tags: <s>57</s> will appear as 57.

/* Configuration */

var QUESTION_ID = 78736; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 32014; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(-?\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (! /<a/.test(lang)) lang = '' + lang + '';
    lang = jQuery(lang).text().toLowerCase();

    languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link, uniq: lang};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.uniq > b.uniq) return 1;
    if (a.uniq < b.uniq) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=617d0685f6f3">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

Pyth, 16
lhf}QjT,vzvz+k.:

Find the shortest substring of A that when inserted between two copies of B results in a string that contains A.
This could be two bytes shorter if the second line didn't have quotes, but that feels weird?
Test Suite

Python 3, 155 168 157 bytes
Total is the length of A. Compare the beginning of A to the end of B and subtract that from total. Compare the beginning of B to the end of A and subtract that from total. Return the absolute value of total unless total is equal to the length, in which case return 0.
def f(A,B):
    T=L=len(A)
    C=D=1
    for i in range(L,0,-1):
        if A[:i]==B[-i:]and C:
            T,C=T-i,0
        if A[-i:]==B[:i]and D:
            T,D=T-i,0
    return (0,abs(T))[T!=-L]

Edit: Handle the f("abcdab","cdabcd")==2 case

Unfortunately this doesn't work for f("abcdab", "cdabcd") which should be 2.

@Neil Good catch. I'll add that to the test cases.

That was unexpected. (Global Twitch Emotes)

@mEQ5aNLrK3lqs3kfSa5HbvsTWe0nIu I was looking at the image and thinking 'This is a nifty debugger idea to use emojis, but I dont see a bug...'. I think that add-on would wreak havoc on this site.

Retina, 49 bytes
.*?(?<=^(?=(.*)(?<4-3>.)*(.*) \2.*\1$)(.)*).+
$#4

Try it online! (Slightly modified to run all tests at once.)
The trick is that we need to backtrack over the part of A that we don't find in B, and so far I haven't found a way to do this without rather annoying lookarounds and balancing groups.

Jolf, 40 Bytes
Wά)Ζ0W<ζli)? h++i]Iζ+ζniIoά0nΖhζ}onhn}wn

Try it!
I'm quite new to Jolf, learned a lot while figuring this out. Seems a bit awkward, still could probably could be golfed down further. Even knocked off 2 bytes while writing this explanation.
Explanation:
  Wά)                                      While ά (initialized to 16)
     Ζ0                                    Set ζ to 0
       W<ζli)                              While ζ < length(A)
             ? h++i]Iζ+ζniIoά0n            Set ά to 0 if (A + a substring from B of length n + A) contains B
                               Ζhζ         Increment ζ
                                  }onhn    Increment n (initialize to 0
                                       }wn Decrement n and print

I haven't tried in earnest, and this may be an optimal solution, but I suggest trying to map over ranges. (s0zli will give you an array [0 ... length i] if you wish to try this approach.)

@Cᴏɴᴏʀ O'Bʀɪᴇɴ Hmm, I'll give that a look... also is there an if command that I jmissed while looking through the documentation/source or is the only option ? with an irrelevant third argument?

? is the closest to an if there is in Jolf. It's like a ternary if. ?ABCs returns B if a is true, andC` otherwise.

05AB1E, 20 bytes
Code:
õ)²Œ«v¹y¹««²åiyg}})ß

Uses CP-1252 encoding. Try it online!.

JavaScript (ES6), 110 bytes
(a,b)=>{for(i=0;;i++)for(j=i;j<=a.length;j++)if(b.startsWith(a.slice(j))&&b.endsWith(a.slice(0,j-i)))return i}

Works by slicing ever longer pieces out of the middle of a until they match the two ends of b. The loop is not infinite as it will stop on or before i == a.length.


text:
The Back-and-Forth Sequence
Imagine a path made up of < and > and ending in a @, e.g.
><>@

A walker starts on the left-most cell. He will traverse the path as follows:

If the walker is on a @ cell, he's reached the goal and is done.
If the walker is on a > cell, the entire path shifts one step to the right, cyclically, taking the walker with it.
If the walker is on a < cell, the entire path shifts one step to the left, cyclically, taking the walker with it.
Afterwards, the walker takes a single step. If he's at either end of the path, he moves away from the end. Otherwise he keeps moving in the direction he moved on the last step (ignoring the rotation), walking right initially.

Let's work through the above example. The walker's position is marked with ^:
><>@   --rotate-->  @><>
^                    ^
step right (first step):
@><>   --rotate-->  ><>@
  ^                  ^
step right:
><>@   --rotate-->  @><>
  ^                    ^
step left (dead end):
@><>   --rotate-->  ><>@
  ^                  ^
step left:
><>@   --rotate-->  @><>
^                    ^
step left:
@><>   Goal reached!
^

The walker visited 6 cells in the process (including the starting cell as well as the @, and counting each cell as often as it's visited).
Here is a small example, where the walker is transported across the edges by a rotation:
>>@   --rotate-->  @>>
^                   ^
step right (first step):
@>>   --rotate-->  >@>
  ^                ^
step right (dead end):
>@>   Goal reached!
 ^

This time the walker visited 3 cells.
We can easily turn this into an integer sequence:

You're given a positive integer N, e.g. 9.
You compute the the binary representation of this integer, e.g. 1001.
Then turn 1 into > and 0 into < and append a @: ><<>@.
We associate with N the number of cells visited by the walker in the number constructed this way.

The first few elements of the resulting sequence are:
2, 3, 3, 4, 6, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
6, 10, 6, 10, 8, 8, 6, 10, 8, 8, 6, 6, 6, 6, 7, 7

This may seem quite arbitrary, but the resulting sequence actually turns out to have a lot of structure:

For reference, you can find the first 2048 numbers of the sequence in this pastebin.
The Challenge
You guessed it: you're to compute the above sequence. You can do that one of three ways:

You can produce an infinite sequence (while memory permits), either by continuously outputting (separated by non-numeric characters) values or by using some form of infinite generator in languages that support them. If you print an infinite stream to STDOUT, you don't have to print the numbers one by one, but make sure that every number would be printed after a finite amount of time (and in order). If you use this option, you should not take any input.
You can take an integer N as input and produce the Nth term of the sequence.
You can take an integer N as input and produce everything up to the Nth term of the sequence, either as a list or string using an unambiguous separator.

Since I don't want to penalise languages which can't easily convert between bases, instead of the integer N you may instead take the binary representation of N, using 0s and 1s as usual (as a list or string), with the most-significant bit first.
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.
Standard code-golf rules apply.
Background
This actually computes the number of "ticks" a straight-forward interpreter of my esoteric programming language Labyrinth would need to interpret the "path" as source code. In that case, the "walker" is simply the instruction pointer (which has a position and a direction), the @ command terminates the program and < and > are source-code modification commands.

which of is required ? 1 , 2, or 3 and how are our submissions scored

@Agawa001 "You can do that one of three ways:" Choose either one of them, whichever you think is easiest for the approach and language you want to use.

Why all the repeating numbers today!?! http://codegolf.stackexchange.com/questions/78787/generate-n-digits-of-gijswijts-sequence :D

Jelly, 10 bytes
ð+\ḤiḤoµL‘

This function accepts a single integer in form of the list of its binary digits as input.
The algorithm is equivalent to the one from @Agawa001's answer.
Try it online! or generate the first 2048 numbers.
Background
Enumerate the positions underneath the path from 0 to L, giving a total of L + 1 positions. L coincides the number of binary digits of the number N that encodes the path. With this notation, the walker starts at position 0, the goal at position L.
With each step the walker takes, he gets one step closer to the goal (in the direction he's currently walking). Also, with each shift-step, depending on whether he walks with or against the shifting direction, he either increments or decrements his position by 2 modulo L + 1, or he stays in the current position.
To change direction, he has to land on position L - 1 (facing L) or position 1 (facing 0), then get shifted in his direction. The next step he takes will bring him back to his previous position, facing the opposite direction.

If L is even, L - 1 is odd, so he cannot advance from his initial position to L - 1 directly. The only way to reach it is to pass through L, getting carried to 0 and taking the next step to land on 1, then advancing to the right. This requires advancing 2L positions, which can be done in no less than L steps.
However, after taking L steps without changing direction, he will have reached the goal. Adding one for the starting cell, we get a total of L + 1 visited cells in this case.
If L is odd, L - 1 is even, so he can reach that position by getting shifted (L - 1) / 2 times to the right. If position L - 1 is underneath a 1 at that time, he will get shifted to position L, turn around, and step on position L - 1 (facing leftwards).
This may or may not happen before he reaches his goal, so there are two cases to analyze:

If there are less than (L + 1) / 2 occurrences of 1 in the binary expansion of N, taking L steps will not suffice to turn direction. Since these L steps bring the walker to his goal, adding one for the starting cell, we get a total of L + 1 visited cells in this case.
If there are at least (L + 1) / 2 occurrences of 1 in the binary expansion of N, advancing to the ((L + 1) / 2)th occurrence will require I steps, where I is the initial position of that occurrence of 1.
Thus, after taking I steps, the walker is in position L - 1, facing leftwards. To turn directions again, he would have to walk advance leftwards to position 1. However, as in the even case, since (L - 1) - 1 is odd, this will require going through 0 and taking no less tha L steps.
Since the initial distance to the goal in the left direction is 1, after taking I steps, the walker finds himself at distance of I + 1 from the goal after changing directions. Since I < L, we have that I + 1 ≤ L, so the next I + 1 steps will bring him to the goal.
This gives a total of I + I + 1 = 2I + 1 taken steps. Adding one for the starting cell, we get a total of 2I + 1 + 1 = 2(I + 1) visited cells in this case.

How it works
ð+\ḤiḤoµL‘  Main link. Argument: x (list of binary digits of N)

       µ    Monadic chain. Argument: x
        L   Compute L, the length of x.
         ‘  Increment to yield L + 1.

ð           Dyadic chain. Left argument: x. Right argument: L + 1
 +\         Compute the cumulative sum of x.
            This replaces the k-th one (and all zeroes to its right) with k.
   Ḥ        Unhalve; multiply all partial sums by 2.
    i       Find the first index of L + 1.
            This either gives I + 1, the 1-based index of the ((L + 1) / 2)-th one
            or 0 if the list doesn't contain L + 1.
            The result will be 0 if x contains less than (L + 1) / 2 ones
            or if L + 1 is an odd integer.
     Ḥ      Unhalve; yield either 2(I + 1) or 0.
      o     Logical OR with L + 1; if the previous operation returned a falsy
            value (i.e., if it yielded 0), replace that value with L + 1.

Matlab (score=230,n=inf)
function w(s,f),b=[];e=0;for i=s:f,a=dec2bin(i);c=find(a=='1');g=numel(a)+1;if numel(c)>=g/2;if mod(g,2)==1,fprintf('%d ',g);else,d=c(g/2);fprintf('%d ',2*d);end,else,fprintf('%d ',g);end,e=e+1;if(e==100),e=0;fprintf('\n');end;end

The function takes s as starting index and f as ending (type inf if you want to keep on to infinite).
The function can go forever without any remarkable time-lag between any two outputs type h=1000000000000000000000000000000000000000000000000000;w(h,h+1) to make sure.
The algorithm follows a mathematical approach that i will explain later, and it does confirm Martin's referenced list, basing on this program:
stored=[2, 3, 3, 4, 6, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 10, 6, 10, 8, 8, 6, 10, 8, 8, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 14, 8, 8, 8, 14, 8, 14, 12, 12, 8, 8, 8, 14, 8, 14, 12, 12, 8, 14, 12, 12, 10, 10, 10, 10, 8, 8, 8, 14, 8, 14, 12, 12, 8, 14, 12, 12, 10, 10, 10, 10, 8, 14, 12, 12, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 18, 10, 10, 10, 10, 10, 10, 10, 18, 10, 10, 10, 18, 10, 18, 16, 16, 10, 10, 10, 10, 10, 10, 10, 18, 10, 10, 10, 18, 10, 18, 16, 16, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 10, 10, 10, 10, 10, 10, 18, 10, 10, 10, 18, 10, 18, 16, 16, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 18, 16, 16, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 18, 10, 10, 10, 18, 10, 18, 16, 16, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 18, 16, 16, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 18, 10, 18, 16, 16, 10, 18, 16, 16, 14, 14, 14, 14, 10, 18, 16, 16, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 10, 18, 16, 16, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 22, 12, 12, 12, 22, 12, 22, 20, 20, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 22, 12, 22, 20, 20, 12, 22, 20, 20, 18, 18, 18, 18, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 22, 20, 20, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13];
b=[];for i=1:numel(stored)
a=dec2bin(i);
c=find(a=='1');
if numel(c)>=(numel(a)+1)/2
if mod(numel(a)+1,2)==1
b=[b numel(a)+1];
else
d=c((numel(a)+1)/2);
b=[b 2*d];
end
else
b=[b numel(a)+1];
end
end
for i=1:numel(stored)
if (b(i))
if b(i)~=stored(i)
'error',
end
end
end

Since the algorithm verifies 2048 first testcases, I will blindly assume it would for any test case, so my algorithm works regarding few properties i discovered in this process without the pain of shifting and moving pointer:
1- if the twice the number of 1's in binary translation doesnt exceed the length of the sequnce L so the output isL+1
2- if the sequence length is even and the previous condition isnt set so the output is same L+1
3- otherwise, the output is twice the L/2th index of 1.

Can you clarify what you mean with "the output is twice the L/2th index of 1."? It's incredibly unclear.

@orlp in this sequence 10010001 the second occurence of 1 is 4, by 2 is 8.

This can be golfed down to at least 89 bytes, a=dec2bin(input(''));c=find(a=='1');g=nnz(a)+1;if nnz(c)<g/2|mod(g,2);g,else,2*c(g/2),end, which only gives a single element of the sequence.

Python, 122 119 113 110 108 107 103 bytes
def l(b):
 p=e=w=len(b);d=i=1
 while e:p+=1-2*b[w-e];d*=2*(1!=d-p>~w)-1;p-=d;e=(e-d)%-~w;i+=1
 return i

Takes input as a list of binary digits. Helper function to test:
b = lambda n: [int(d) for d in bin(n)[2:]]

Credit to Lynn for saving 7 bytes.

Pew pew pew. :D

It’s not much, but… I suppose p-d-1in[-2,w] saves one byte.

Changing the statement to d*=2*(1!=d-p>~w)-1 saves four more! °v°

@Lynn Nice use of de Morgan's laws!

can u please provide a wide output range to compare with mine ? thanx

Python 2, 99 bytes
def l(b):l=len(b);return(l>=sum(b)*2or l%2<1)and-~l or[i+1for i,c in enumerate(b)if b[i]][l/2]*2

Python port of Agawa001's brilliant answer.
Readable version:
def l(b):
    if len(b) >= 2*sum(b) or len(b)%2 == 0:
        return len(b) + 1

    return 2*[i+1 for i, c in enumerate(b) if b[i]][len(b)//2]

@Agawa001 I haven't understood your algorithm yet, but I have experimentally verified it up to 10 million.

MATL, 31, 25 bytes
BXHnQtHsy2/<w2\+~?2/Hfw)E

This is just a MATL version of Agawa001's algorithm, except it takes an integer input N and returns the N-th term in the sequence. It was tricky keeping up with all the elements in the stack! I had to resort to using a clipboard to avoid going insane. You can Try it online!
Can be made into a loop printing the first N terms by adding :"@ before the code, and ]D after.
Thanks to Luis Mendo for saving 6 whole bytes!

Julia 0.4, 4̷4̷  42 bytes
x->(k=endof(x)+1;try k=2find(x)[k/2]end;k)

This function accepts a single integer in form of the list of its binary digits as input.
The algorithm is equivalent to the one from @Agawa001's answer and my Jelly answer.
Try it online!
How it works
find(x) returns the 1-based indices of all non-zero elements of x. We attempt to access the resulting array at index k / 2 and, if successful, overwrite k with twice the selected index.
This will fail if and only if one of the following is true:

k / 2 is a non-integral float, so and InexactError is raised.
The index array has less than k / 2 elements, so a BoundsError is raised.

In either case, overwriting k will fail, so its original value will be returned.

Python 2, 74 bytes
def f(x):k=len(x)+1;print next((i*2for i in range(k)if k==2*sum(x[:i])),k)

This function accepts a single integer in form of the list of its binary digits as input.
The algorithm is equivalent to the one from @Agawa001's answer and my Jelly answer.
Test it on Ideone.
How it works
next attempts to find the first integer 2i for which k==2*sum(x[:i]) returns true. Since x[:i] contains i elements, this gives the 1-based index of the (k / 2)th 1.
next will fail if k/2 is non-integral or if x contains less than k / 2 ones. In this case, the default value k is returned.

JavaScript (ES6), 65 bytes
s=>(l=s.length+1)%2|!(m=s.match(`(0*1){$l/2}}`))?l:m[0].length*2

Accepts a binary string. Uses the bounce check from the various other answers.

><>, 63 bytes
2r11&>}:?v{1->:l2-%?vr{{$>1+$}$:2=$@&101.
 +&?!^&n;>{1+^ .0+bf<

From the moment I saw the example pattern in this challenge, I knew which language to use :)
Using N to get the Nth term.
Input assumed to be in binary at the stack. Rather than moving the walker around, this solution relies mostly on moving the tape under the walker.
Try it online!


text:
Find the Matrix Power
Problem
Create a program or function that can calculate the result of a matrix raised to the nth power. Your code will take an arbitrary square matrix A and a non-negative integer n, and return a matrix with the value An.
Restrictions
Built-in functions that compute the matrix power and matrix product are not allowed.
The rest of the standard rules for code-golf apply.
Explanation
Given a square matrix A, the value of An = A A ⋯ A (repeated matrix product of A with itself, n times). If n is positive, the standard just mentioned is used. When n is zero, the identity matrix with the same order of A is the result.
Goal
This is code-golf and the shortest code wins.
Test Cases
Here, A is the input matrix, n is the input integer, and r is the output matrix where r = An.
n = 0
A = 62 72
    10 34
r =  1  0
     0  1

n = 1
A = 23 61 47
    81 11 60
    42  9  0
r = 23 61 47
    81 11 60
    42  9  0

n = 2
A =  12  28 -26  3
     -3 -10 -13  0
     25  41   3 -4
    -20 -14  -4 29
r = -650 -1052  -766 227
    -331  -517   169  43
     332   469 -1158 -53
    -878  -990   574 797

n = 4
A = -42 -19  18 -38
    -33  26 -13  31
    -43  25 -48  28
     34 -26  19 -48
r = -14606833  3168904 -6745178  4491946
      1559282  3713073 -4130758  7251116
      8097114  5970846 -5242241 12543582
     -5844034 -4491274  4274336 -9196467

n = 5
A =  7  0 -3  8 -5  6 -6
     6  7  1  2  6 -3  2
     7  8  0  0 -8  5  2
     3  0  1  2  4 -3  4
     2  4 -1 -7 -4 -1 -8
    -3  8 -9 -2  7 -4 -8
    -4 -5 -1  0  5  5 -1
r =  39557  24398 -75256 131769  50575   14153  -7324
    182127  19109   3586 115176 -23305    9493 -44754
    146840  31906 -23476 190418 -38946   65494  26468
     42010 -21876  41060 -13950 -55148   19290   -406
     44130  34244 -35944  34272  22917  -39987 -54864
      1111  40810 -92324  35831 215711 -117849 -75038
    -70219   8803 -61496   6116  45247   50166   2109

What about built-ins for matrix product or matrix inversion?

@Dennis I was considering banning those also, but it felt too restrictive.

For languages without built-in matrix inversion, this strike me as a chameleon challenge because inverting a matrix from scratch seems much harder than taking the iterated product.

I agree with @xnor. And what if a language doesn't have matrix inversion but has matrix power? Can A^-1 be used as a substitute for inv(A)?

Is exp(k*log(M)) allowed? (Though it might not work because of non-unique branches.)

@xnor Thank for your views on chameleon challanges. Actually, it might be better to drop the negative power aspect, and restrict matrix product. Matrix inverse has too many other ways to be computed when using languages with matrix operations. It would be too hard to restrict.

Are builtins for matrix inversion allowed now, since computing negative powers is no longer necessary?

@Mego I never restricted builtins for matrix inverse. If you know a method that can be made shorter using it, feel free to use it.

Can we take the size of the matrix as an input?

Jelly, 17 16 15 bytes
Z×'³S€€
LṬ€z0Ç¡

Try it online!
Permalinks with grid output: test case 1 | test case 2 | test case 3 | test case 4 | test case 5
How it works
LṬ€z0Ç¡  Main link. Arguments: A (matrix), n (power)

L        Get the length l of A.
 Ṭ€      Turn each k in [1, ..., l] into a Boolean list [0, 0, ..., 1] of length k.
   z0    Zip; transpose the resulting 2D list, padding with 0 for rectangularity.
         This constructs the identity matrix of dimensions k×k.
     Ç¡  Execute the helper link n times.

Z×'³S€€  Helper link. Argument: B (matrix)

Z        Zip; transpose rows and columns of B.
   ³     Yield A.
 ×'      Spawned multiplication; element-wise mutiply each rows of zipped B (i.e.,
         each column of B) with each row of A.
         This is "backwards", but multiplication of powers of A is commutative.
    S€€  Compute the sum of each product of rows.

MATL, 20 bytes
XJZyXyi:"!J2$1!*s1$e

Try it online!
Explanation
This avoids the matrix multiplication by doing it manually, using element-wise multiplication with broadcast followed by vectorized sum. Specifically, to multiply matrices M and N, both of size s×s:

Transpose M. Call the resulting matrix P.
Permute the dimensions of N such that N is "turned" with a rotation axis along the first dimension, giving an s×1×s 3D array, say Q.
Multiply each element of P times each element of Q, with implicit broadcast. This means that P is automatically replicated s times along the third dimension, and Q is replicated s times along the second, to make them both s×s×s, before the actual element-wise multiplication takes place.
Sum along the first dimension to yield a 1×s×s array.
Squeeze the leading singleton dimension out, to produce an s×s result.

Commented code:
XJ      % take matrix A. Copy to clipboard J
ZyXy    % generate identity matrix of the same size
i:      % take exponent n. Generate range [1 2 ... n] (possibly empty)
"       % for each element in that range
  !     %   transpose matrix with product accumulated up to now (this is step 1)
  J     %   paste A
  2$1!  %   permute dimensions: rotation along first-dimension axis (step 2)
  *     %   element-wise multiplication with broadcast (step 3)
  s     %   sum along first dimension (step 4)
  1$e   %   squeeze out singleton dimension, i.e. first dimension (step 5)
        % end for. Display

Fails for 0....

@CatsAreFluffy Thanks! Corrected

APL, 32 31 chars
{⍺=0:(⍴⍵)⍴1⍨1+≢⍵⋄+.×⍨⍣(⍺-1)⊣⍵}

Left argument the power to raise to, right argument the matrix. The hardest (most space consuming) bit is building the identity matrix for the case where the desired exponent is 0.
The actual computation is based on the fact that the generalised inner product (.) with + and × as operands is effectively the matrix product. This combined with the power ⍣ operator ("repeat") forms the meat of the solution.

1: Are you THE Stefano that beat Dan&Nick by one byte in the 2016 year game?! 2. (1+≢⍵)↑1 => 1↑⍨1+≢⍵ to save one byte.

Yes, that's me.

K (ngn/k), 14 bytes
{y(+/x*)'/=#x}

Try it online!
-2 bytes thanks to @coltim on the k tree. The inner train multiplies x on the right side of the current matrix (instead of left side).
Why (+/x*)' is also a matmul:
(+/(e f;g h)*)' (a b;c d)
( (+/(e f;g h)*) a b; (+/(e f;g h)*) c d )
( +/ (ae af;bg bh) ; +/ (ce cf;dg dh) )
((ae+bg) (af+bh); (ce+dg) (cf+dh))

K (ngn/k), 16 bytes
{y(+/'x*\:)/=#x}

Try it online!
Original solution. Takes [matrix; n] and computes matrix^n.
How it works
{y(+/'x*\:)/=#x}  x:matrix; y:n
            =#x   Identity matrix of size of x
 y(       )/      Repeat y times:
      x*\:        Multiply each row of x to each column of current matrix
   +/'            Sum each to get the matrix product

Why +/'*\: is a matmul:
(a b;c d) *\: (e f;g h)
multiply-eachleft expands to
(a b * (e f;g h) ; c d * (e f;g h))
atomic application gives
((ae af
  bg bh)
 (ce cf
  dg dh))
so applying +/' on this will give the result of matmul.

Sage, 112 bytes
lambda A,n:reduce(lambda A,B:[[sum(map(mul,zip(a,b)))for b in zip(*B)]for a in A],[A]*n,identity_matrix(len(A)))

Try it online
Explanation:
The inner lambda (lambda A,B:[[sum(map(mul,zip(a,b)))for b in zip(*B)]for a in A]) is a straightforward implementation of matrix multiplication. The outer lambda (lambda A,n:reduce(...,[A]*n,identity_matrix(len(A)))) uses reduce to compute the matrix power by iterated matrix multiplication (using the aforementioned homemade matrix multiplication function), with the identity matrix as the initial value to support n=0.

Julia, 90 86 68 bytes
f(A,n)=n<1?eye(A):[A[i,:][:]⋅f(A,n-1)[:,j]for i=m=1:size(A,1),j=m]

This is a recursive function that accepts a matrix (Array{Int,2}) and an integer and returns a matrix.
Ungolfed:
function f(A, n)
    if n < 1
        # Identity matrix with the same type and dimensions as the input
        eye(A)
    else
        # Compute the dot product of the ith row of A and the jth column
        # of f called on A with n decremented
        [dot(A[i,:][:], f(A, n-1)[:,j]) for i = (m = 1:size(A,1)), j = m]
    end
end

Try it online! (includes all but the last test case, which is too slow for the site)
Saved 18 bytes thanks to Dennis!

Python 2.7, 158 145 bytes
The worst answer here, but my best golf in Python yet. At least it was fun learning how to do matrix multiplication.
Golfed:
def q(m,p):
 r=range(len(m))
 if p<1:return[[x==y for x in r]for y in r]
 o=q(m,p-1)
 return[[sum([m[c][y]*o[x][c]for c in r])for y in r]for x in r]

Explanation:
#accepts 2 arguments, matrix, and power to raise to
def power(matrix,exponent):
 #get the range object beforehand
 length=range(len(matrix))
 #if we are at 0, return the identity
 if exponent<1:
  #the Boolean statement works because Python supports multiplying ints by bools
  return [[x==y for x in length] for y in length]
 #otherwise, recur
 lower=power(matrix,exponent-1)
 #and return the product
 return [[sum([matrix[c][y]*lower[x][c] for c in length]) for y in length] for x in length]

Julia, 27 24
a$n=round.(exp(log(a)n))

I am not sure what is allowed, but...
julia> a
5×5 Matrix{Int64}:
 35  18  40  37  77
 31   5  45  23  73
 62  67  29  85  97
 20   9  83  70  65
  2  13  53  59  52

julia> round.(exp(log(a)5)) ≈ a^5
true

24 thanks to @MarcMush.

Jelly, 11 bytes
L=þ`Zḋþ³ƊƓ¡

Try it online!
A more modern update to Dennis' answer, be sure to give that an upvote.
Additionally, this is a 9 byte answer that takes the dimensions of the matrix as the first 2 command line args and the matrix as the third.
Both take the power via STDIN.
How it works
L=þ`Zḋþ³ƊƓ¡ - Main link. Takes A on the left
L           - Length of A, L
   `        - Using L as both arguments:
  þ         -   Create an LxL matrix, where the element at (i,j) is:
 =          -     Does i = j?
               This creates an identity matrix LxL
         Ɠ  - Read an integer from STDIN, n
        Ɗ ¡ - Do the following n times:
    Z       -   Transpose
       ³    -   Yield A
      þ     -   Pair all rows of the transposed matrix with the rows of A and, over each row:
     ḋ      -     Dot product

I was about to ask for this (an updated Jelly answer) when coltim found the 14-byter in K, but you ninjad me :P

JavaScript (ES6), 123 bytes
(n,a)=>[...Array(n)].map(_=>r=m(i=>m(j=>m(k=>s+=a[i][k]*r[k][j],s=0)&&s)),m=g=>a.map((_,n)=>g(n)),r=m(i=>m(j=>+!(i^j))))&&r

I had a 132 byte version using reduce but I was just mapping over a so often that it turned out to be 9 bytes shorter to write a helper function to do it for me. Works by creating the identity matrix and multiplying it by a longhand n times. There are a number of expressions that return 0 or 1 for i == j but they all seem to be 7 bytes long.

(n,a)=>... -> n=>a=>...

Python 3, 147 bytes
def f(a,n):
 r=range(len(a));r=[[i==j for j in r]for i in r]
 for i in range(n):r=[[sum(map(int.__mul__,x,y))for y in zip(*a)]for x in r]
 return r

Try it online!

R, 49 bytes
f=function(m,n)`if`(n,m%*%f(m,n-1),diag(nrow(m)))

Recursive function that takes a matrix and the power n to raise it to. Recursively calls %*%, which computes the dot-product. The initial value for the recursion is the identity matrix of the same size as m. Since m %*% m = m %*% m %*% I, this works just fine.

Python 3, 128 bytes
def f(A,n):r=range(len(A));return n and[[sum(A[i][j]*x[i]for i in r)for j in r]for x in f(A,n-1)]or[[i==j for i in r]for j in r]

Try it online!

Python 2, 131 bytes
f=lambda M,n:n and[[sum(map(int.__mul__,r,c))for c in zip(*f(M,n-1))]for r in M]or[[0]*i+[1]+[0]*(len(M)+~i)for i in range(len(M))]

Try it online!

05AB1E, 11 bytes
²āDδQ¹Føδ*O

Try it online! Footer formats output as a grid.
²āDδQ pushes the identity matrix to the stack:
²ā range from 1 to the length of the second input
DδQ equality table with itself
¹F iterate first input times:
øδ*O multiply current matrix with input matrix:
ø transpose current matrix
δ* 3d multiplication table with input and transposed matrix
O sum along last axis

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


text:
Swap Pairs or Remove
Specification
For this challenge you will:

Take an array of positive integers.
For each overlapping pair in the array, calculate the difference of it's integers. If the difference is a common divisor of the integers (they are both divisible by their difference), swap their positions in the array. The values of the next pair are affected by this swap. No integer is divisible by 0.
If an integer was not divisible by the difference of any of it's pairs, remove it from the array.
Repeat the previous two steps until the length of the array will not decrease any further.
Output the length of the resulting array.

Example

Input = [ 4, 5, 2, 4 ].
Difference of first pair [ ( 4, 5, ) 2, 4 ] = 1, (common divisor of 4 and 5)

Swap the pair and the array becomes [ 5, 4, 2, 4 ].

Difference of second pair [ 5, ( 4, 2, ) 4 ] = 2 (common divisor of 4 and 2)

Swap the pair so the array becomes [ 5, 2, 4, 4 ].

Difference of third pair [ 5, 2, ( 4, 4 ) ] = 0 (not a divisor of any integer)

Do not swap the pair so the array remains the same.

The final 4 was never swapped, remove it so the array becomes [ 5, 2, 4 ].
Repeat.
Difference of first pair [ ( 5, 2, ) 4 ] = 3

Do not swap the pair so the array remains the same.

Difference of second pair [ 5, ( 2, 4 ) ] = 2

Swap the pair so the array becomes [ 5, 4, 2 ].

The 5 was never swapped, remove it so the array becomes [ 4, 2 ]
Repeat.
From here the array will endlessly switch between [ 4, 2 ] and [ 2, 4 ], so output the resulting length of 2.

Rules

Input array will always have a length between 2 and 9 inclusive.
Integers will always be between 1 and 999 inclusive.
Input can optionally be in the form of a string delimited by a specific character.
This is code-golf so shortest code in bytes wins.

Test Cases
Format: [ input array ] = result (steps to get result, do not output this)
[ 1, 1 ] = 0                        ([])
[ 1, 2 ] = 2                        ([ 2, 1 ] -> [ 1, 2 ] -> ...)
[ 1, 2, 3 ] = 2                     ([ 2, 1 ] -> [ 1, 2 ] -> ...)
[ 4, 6, 8 ] = 3                     ([ 6, 8, 4 ] -> [ 8, 4, 6 ] -> [ 4, 6, 8 ] -> ...)
[ 99, 1, 3 ] = 0                    ([])
[ 4, 5, 2, 4 ] = 2                  ([ 5, 2, 4 ] -> [ 4, 2 ] -> [ 2, 4 ] -> ...)
[ 12, 4, 6, 3 ] = 3                 ([ 6, 4, 3 ] -> [ 4, 3, 6 ] -> [ 3, 6, 4 ] -> ...)
[ 9, 6, 10, 18 ] = 2                ([ 6, 10, 18, 9 ] -> [ 9, 18 ] -> [ 18, 9 ] -> ...)
[ 55, 218, 654, 703, 948, 960 ] = 2
[ 954, 973, 925, 913, 924, 996, 927, 981, 905 ] = 2

Are you sure of the last test case? I get 2 [924, 996, 913] -> [913, 996]

@edc65 Oops, you're right. Fixed.

... and [12,4,6,3] -> [6,3,4] -> [3,4,6] -> [4,6,3]

JavaScript (ES6), 133
Recursive function.
F=(m,k=[])=>(k[m]=m,f=m.map((x,i)=>x%(w=x-(y=m[i+1]))==0&y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=>f[i-1]|f[i])]?m.length:F(m,k))

Less golfed and not recursive
F=m=>{
  for(k=[];!k[m];) // use k to find a repeated state and exit the loop
  {
    k[m]=1
    console.log(m)
    // loop for swap and mark swap position in array f
    f=m.map((x,i)=>(
      y=m[i+1], // next element
      w=x-y,    // difference
      x%w==0&y%w==0 // if common divisor ...
        ?m[m[i+1]=x,i]=y // swap elements,mark with nonzero
        :0 // no swap, mark with 0
    ))
    m=m.filter((x,i)=>f[i-1]|f[i]) // remove elements not swapped
  }
  return m.length
}

Test

F=(m,k=[])=>(k[m]=m,f=m.map((x,i)=>x%(w=x-(y=m[i+1]))==0&y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=>f[i-1]|f[i])]?m.length:F(m,k))

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

;[[1,1],[1,2],[1,2,3],[4,6,8],[99,1,3],[4,5,2,4],[12,4,6,3],[9,6,10,18]
,[ 55, 218, 654, 703, 948, 960 ],[ 954, 973, 925, 913, 924, 996, 927, 981, 905 ]]
.forEach(t=>console.log(t+' -> '+F(t)))


text:
Generate n digits of Gijswijt's sequence
Introduction
Gijswijt's sequence (A090822) is famously really, REALLY slow. To illustrate:

The first 3 appears in the 9th term (alright).
The first 4 appears in the 220th term (a long way away, but feasible).
The first 5 appears at (approximately) the 10^(10^23)th term (just no).
No one really even knows where the first 6 is... it's suspected it's at the...

2^(2^(3^(4^5)))th term.

You can assume that you won't have to deal with a two-digit number.
The sequence is generated like so:

The first term is 1.
Each term after that is the amount of repeating "blocks" previous to it (if there are multiple repeating "blocks", the largest amount of repeating blocks is used).

To clarify, here are the first few terms.
1 -> 1, 1 (one repeating block (1), so the digit recorded is 1)
1, 1 -> 1, 1, 2 (two repeating blocks (1), so the digit recorded is 2)
1, 1, 2 -> 1, 1, 2, 1 (one repeating block (2 or 1, 1, 2), so the digit recorded is 1)
1, 1, 2, 1 -> 1, 1, 2, 1, 1 (you get the idea)
1, 1, 2, 1, 1 -> 1, 1, 2, 1, 1, 2
1, 1, 2, 1, 1, 2 -> 1, 1, 2, 1, 1, 2, 2 (two repeating blocks (1, 1, 2), so the digit recorded is 2)
Task
Your task is, as stated in the question, to generate n digits of the Gijswijt sequence.
Instructions

The input will be an integer n.
Your code can output the digits in any form (a list, multiple outputs, etc.).

This is code golf, so shortest code in bytes wins.

Pyth, 25 22 21 bytes
t_u+eSmtfxG*Td1._GGQN

OP confirmed that we only need to handle single-digit numbers. This allowed to store the list as a string of digits. -> Saved 3 bytes
Try it online: Demonstration
Explanation:
t_u+...GQN      implicit: Q = input number
         N      start with the string G = '"'
  u     Q       do the following Q times:
    ...            generate the next number
   +   G           and prepend it to G
 _              print reversed string at the end
t               remove the first char (the '"')

And here's how I generate the next number:
eSmtfxG*Td1._G
           ._G    generate all prefixes of G
  m               map each prefix d to:
    f     1          find the first number T >= 1, so that:
       *Td              d repeated T times
     xG                 occurs at the beginning of G
 S                  sort all numbers
e                   take the last one (maximum)

21 bytes with lists
_u+eSmhhrcGd8SlGGtQ]1

Try it online: Demonstration
Uses the same ideas of Martin and Peter. At each step I split the string into pieces of length 1, pieces of length 2, ... Then I range-length-encode them and use the maximal first run as next number.
20 bytes with strings
t_u+eSmhhrcGd8SlGGQN

Try it online: Demonstration
Combines the ideas of the two codes above.

Thanks for teaching me. I always forget the ._ function and other useful functions in Pyth.

I personally liked the original solution more, but eh.

@Jakube Ah. Can I have a look? If yes, then thanks!

@DerpfacePython Was able to golf one additional byte to my original solution. I also posted the run-length-encoding solution based on Martin, and then was able to combine the two approaches to generate a 20 bytes solution.

CJam, 33 31 30 27 bytes
Thanks to Peter Taylor for saving 1 byte.
1sri({),:)1$W%f/:e`$W=sc+}

Test it here.
Explanation
1s      e# Initialise the sequence as "1".
ri(     e# Read input N and decrement.
{       e# For each I from 0 to N-1...
  )     e#   Increment to get I from 1 to N.
  ,     e#   Turn into a range [0 1 ... I-1].
  :)    e#   Increment each element to get [1 2 ... I].
  1$    e#   Copy sequence so far.
  W%    e#   Reverse the copy.
  f/    e#   For each element x in [1 2 ... I], split the (reversed) sequence
        e#   into (non-overlapping) chunks of length x. These are the potentially
        e#   repeated blocks we're looking for. We now want to find the splitting
        e#   which starts with the largest number of equal blocks.
  :e`   e#   To do that, we run-length encode each list blocks.
  $     e#   Then we sort the list of run-length encoded splittings, which primarily
        e#   sorts them by the length of the first run.
  W=    e#   We extract the last splitting which starts with the longest run.
  sc    e#   And then we extract the length of the first run by flattening
        e#   the list into a string and retrieving the first character.
  +     e#   This is the new element of the sequence, so we append it.
}/

+1 for :) (5 more to go...)

CJam (30 29 27 24 bytes)
'1ri{{)W$W%/e`sc}%$W>+}/

Online demo
This is very much a joint effort with Martin.

The clever use of run-length encoding (e`) to identify repetitions is Martin's
So is the use of W$ to simplify the stack management
I eliminated a couple of increment/decrement operations by using $W>+ special-casing, as explained in the dissection below

My first 30-byte approach:
1ari{,1$f{W%0+_@)</{}#}$W>+}/`

Online demo
Dissection
1a        e# Special-case the first term
ri{       e# Read int n and iterate for i=0 to n-1
  ,1$f{   e#   Iterate for j=0 to i-1 a map with extra parameter of the sequence so far
    W%0+  e#     Reverse and append 0 to ensure a non-trivial non-repeating tail
    _@)</ e#     Take the first j+1 elements and split around them
    {}#   e#     Find the index of the first non-empty part from the split
          e#     That's equivalent to the number of times the initial word repeats
  }
  $W>+    e#   Add the maximal value to the sequence
          e#   NB Special case: if i=0 then we're taking the last term of an empty array
          e#   and nothing is appended - hence the 1a at the start of the program
}/
`         e# Format for pretty printing

Haskell, 97 bytes
f 1=[1]
f n|x<-f$n-1=last[k|k<-[1..n],p<-[1..n],k*p<n,take(k*p)x==([1..k]>>take p x)]:x
reverse.f

The third line defines an anonymous function that takes an integer and returns a list of integers.
See it in action.
Explanation
The helper function f constructs the sequence in reverse, by recursively checking whether the previous sequence begins with a repeated block.
k is the number of repetitions, and p is the length of the block.
f 1=[1]                                   -- Base case: return [1]
f n|x<-f$n-1=                             -- Recursive case; bind f(n-1) to x.
  last[k|k<-[1..n],                       -- Find the greatest element k of [1..n] such that
  p<-[1..n],                              -- there exists a block length p such that
  k*p<n,                                  -- k*p is at most the length of x, and
  take(k*p)x                              -- the prefix of x of length p*k
    ==                                    -- is equal to
  ([1..k]>>take p x)                      -- the prefix of length p repeated k times.
  ]:x                                     -- Insert that k to x, and return the result.
reverse.f                                 -- Composition of reverse and f.

Retina, 66 60 bytes
+1`((\d+)?(?<1>\2)*(?<!\3(?>(?<-1>\3)*)(?!.*\2)(.+)))!
$1$#1

Input is a unary integer using ! as the digit (although that could be changed to any other non-numeric character). Output is simply a string of digits.
Try it online! (Alternatively, for convenience here's a version that takes decimal input.)
For testing purposes, this can be sped up a lot with a small modification, which allows testing of input 220 in under a minute:
+1`((\d+)?(?<1>\2)*(?=!)(?<!\3(?>(?<-1>\3)*)(?!.*\2)(.+)))!
$1$#1

Try it online! (Decimal version.)
If you want to test even larger numbers, it's best to just feed it some massive input and put a : after the initial +. This will make Retina print the current sequence each time it finishes computing a new digit (with all the digits off-by-one).
Explanation
The solution consists of a single regex substitution, which is applied to the input repeatedly until the result stops changing, which in this case happens because the regex no longer matches. The + at the beginning introduces this loop. The 1 is a limit which tells Retina only to replace the first match (this is only relevant for the very first iteration). In each iteration, the stage replaces one ! (from the left) with the next digit of the sequence.
As usual, if you need a primer on balancing groups I refer you to my SO answer.
Here is an annotated version of the regex. Note that the goal is to capture the maximum number of repeated blocks in group 1.
(                 # Group 1, this will contain some repeated block at the end
                  # of the existing sequence. We mainly need this so we can
                  # write it back in the substitution. We're also abusing it
                  # for the actual counting but I'll explain that below.
  (\d+)?          # If possible (that is except on the first iteration) capture
                  # one of more digits into group 2. This is a candidate block
                  # which we're checking for maximum repetitions. Note that this
                  # will match the *first* occurrence of the block.
  (?<1>\2)*       # Now we capture as many copies of that block as possible
                  # into group 1. The reason we use group 1 is that this captures
                  # one repetition less than there is in total (because the first
                  # repetition is group 2 itself). Together with the outer
                  # (unrelated) capture of the actual group one, we fix this
                  # off-by-one error. More importantly, this additional capture
                  # from the outer group isn't added until later, such that the
                  # lookbehind which comes next doesn't see it yet, which is
                  # actually very useful.
                  # Before we go into the lookbehind note that at the end of the
                  # regex there's a '!' to ensure that we can actually reach the
                  # end of the string with this repetition of blocks. While this
                  # isn't actually checked until later, we can essentially assume
                  # that the lookbehind is only relevant if we've actually counted
                  # repetitions of a block at the end of the current sequence.

  (?<!            # We now use a lookbehind to ensure that this is actually the
                  # largest number of repetitions possible. We do this by ensuring
                  # that there is no shorter block which can be matched more
                  # often from the end than the current one. The first time this
                  # is true (since, due to the regex engine's backtracking rules,
                  # we start from longer blocks and move to shorter blocks later),
                  # we know we've found the maximum number of repetitions.
                  # Remember that lookbehinds are matched right-to-left, so
                  # you should read the explanation of the lookbehind from
                  # bottom to top.
    \3            # Try to match *another* occurrence of block 3. If this works,
                  # then this block can be used more often than the current one
                  # and we haven't found the maximum number of repetitions yet.
    (?>           # An atomic group to ensure that we're actually using up all
                  # repetitions from group 1, and don't backtrack.
      (?<-1>\3)*  # For each repetition in group 1, try to match block 3 again.
    )
    (?!.*\2)      # We ensure that this block isn't longer than the candidate
                  # block, by checking that the candidate block doesn't appear
                  # right of it.
    (.+)          # We capture a block from the end into group 3.
  )               # Lookbehind explanation starts here. Read upwards.
)
!                 # As I said above, this ensures that our block actually reaches
                  # the end of the string.

Finally, after this is all done, we write back $1 (thereby deleting the !) as well as the number of captures in the group with $#1 which corresponds to the maximum number of repetitions.

Why does Retina take unary solutions instead of numbers?

@DerpfacePython Because it's cheaper and allowed by consensus. You're free to overrule that by specifying that input has to be a decimal number (in which case I'm happy to change the solution).

Ah, thanks for the clarification. Just out of curiousity, though, can you put (in the comments) an answer for decimal? If so, thanks.

@DerpfacePython Added separate links using decimal input.

Explanation when I'm done golfing?

@CatsAreFluffy Oh, uh, yeah... I'll have another look at it, and then explain it.

@CatsAreFluffy done

Pyth, 41 38 bytes
J]1VSQ=J+h.MZmh+fn@c+J0dT<JdSNZSNJ;P_J

Try it online!

Ruby, 84 bytes
The Retina answer inspired me to do a regex-based solution to find the best sequence instead of somehow counting sequences in an array, but with less of the genius (negative lookbehinds with quantifiers don't seem to be allowed in Ruby, so I doubt I could directly port Retina's answer over anyways)
->n{s='';n.times{s+=(1..n).map{|i|s=~/(\d{#{i}})\1+$/?$&.size/i: 1}.max.to_s};s[-1]}

Given an already-generated sequence s, it maps over all i from 1 to s.length (n was used in this case to save bytes since n>=s.length) and then uses this regex to help calculate the number of repetitions of a subsequence with length i:
/(.{#{i}})\1+$/
/(                 # Assign the following to group 1
  .{#{i}}          # Match `i` number of characters
         )         # End group 1
          \1+      # Match 1 or more repetitions of group 1
             $/    # Match the end of string

If a match is found of that length, it calculates the number of repetitions by dividing the length of the given match $& by i, the length of the subsequence; if no match was found, it is treated as 1. The function then finds the maximum number of repetitions from this mapping and adds that number to the end of the string.