Remove digits, retaining greater number Introduction

This challenge consists in finding the greatest number removing y digits from the original number n which has x digits.

Assuming y=2 n=5263 x=4, the possible numbers removing y=2 digits are:

[52, 56, 53, 26, 23, 63]

So, the greatest number is 63 which must be the output for this example.

Another logic would be: for each y, search from left to right the digit which right next digit is greater, then remove it, else when no match, remove the last y-digits.

Using y=3 n=76751432 x=8 to explain:

y=3
76751432
-^------ remove 6 because right next 7 is greater

y=2
7751432
---^--- remove 1 because right next 4 is greater

y=1
775432
-----^ the search failed, then remove last y digits

result = 77543

Both methods explained above works.. of course, you can use another method too :)

Challenge

The number n won't have more than 8 digits, and y will always be greater than zero and lower than x.

To avoid strict input format, you can use the values: y n x the way you prefer: as parameters in function, raw input, or any other valid way. Just don't forget to say how you did that in your answer.

The output should be the result number.

This is code-golf, the shortest answer in bytes wins.

Example Input and Output

Again: you do not need to be too strict :)

4 1789823 7 -> 983
1 54132 5   -> 5432
3 69314 5   -> 94
2 51794 5   -> 794

Edit

I changed the input order to reflect the fact that some of you may not need the x value to solve the problem. x is now an optional value.

MATL, 10 bytes

-jowXncUX>

This uses version (9.2.1) of the language/compiler, which is earlier than this challenge.

It takes three inputs from stdin in this order: string length, number of removed characters, string.

Example

>> matl
 > -jowXncUX>
 >
> 7
> 4
> 1789823
983

EDIT: Try it online! (the code in the link has XN instead of Xn to conform to changes in the language after this challenge; also, o is not needed anymore)

Explanation

(This still costs 2 bytes more than it should due to Octave's and Matlab's nchoosek function behaving differently. Fixed in the next release of the compiler.)

-        % implicitly input two numbers, and subtract them
jo       % input string, and convert to ASCII codes
wXn      % swap inputs. Generate all combinations, each in a row
c        % convert to char array
U        % convert each row to a number
X>       % get maximum. Implicitly display

Answer to original challenge (stricter input requirements): 16 bytes

jYbZ)b-wowXncUX>

Uses current version (9.2.1) of the language/compiler.

Example

>> matl jYbZ)b-wowXncUX>
> 4 1789823 7
983

Explanation

(This should have been 4 bytes less, but I need that wow...c because Octave's nchoosek function, unlike Matlab's, doesn't work with character input. Will be fixed for next release of the compiler.)

j              % input string
YbZ)           % split at spaces into strings
b-             % subtract first and third (1-digit) strings
wow            % convert middle string into ASCII codes
Xn             % get all combinations, each in a row
c              % convert to char array
U              % convert each row to a number
X>             % get maximum. Implicitly display


Find the first duplicated element Given an array a that contains only numbers in the range from 1 to a.length, find the first duplicate number for which the second occurrence has the minimal index. In other words, if there are more than 1 duplicated numbers, return the number for which the second occurrence has a smaller index than the second occurrence of the other number does. If there are no such elements, your program / function may result in undefined behaviour.

Example:

For a = [2, 3, 3, 1, 5, 2], the output should be
firstDuplicate(a) = 3.

There are 2 duplicates: numbers 2 and 3. The second occurrence of 3 has a smaller index than the second occurrence of 2 does, so the answer is 3.

For a = [2, 4, 3, 5, 1], the output should be
firstDuplicate(a) = -1.

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

BONUS: Can you solve it in O(n) time complexity and O(1) additional space complexity?

Python 2, 34 bytes

O(n2) time, O(n) space

Saved 3 bytes thanks to @vaultah, and 3 more from @xnor!

lambda l:l[map(l.remove,set(l))<0]

Try it online!


Last Nonzero Digits of a Factorial in Base You should write a program or function which given three positive integers n b k as input outputs or returns the last k digits before the trailing zeros in the base b representation of n!.

Example

n=7 b=5 k=4
factorial(n) is 5040
5040 is 130130 in base 5
the last 4 digits of 130130 before the trailing zeros are 3013
the output is 3013

Input

3 positive integers n b k where 2 <= b <= 10.
The order of the input integers can be chosen arbitrarily.

Output

A list of digits returned or outputted as an integer or integer list.
Leading zeros are optional.
Your solution has to solve any example test case under a minute on my computer (I will only test close cases. I have a below-average PC.).

Examples

New tests added to check correctness of submissions. (They are not part of the under 1 minute runtime rule.)

Input => Output (with the choice of omitting leading zeros)

3 10 1  =>  6

7 5 4  =>  3013

3 2 3  =>  11

6 2 10  =>  101101

9 9 6  =>  6127

7 10 4  =>  504

758 9 19  =>  6645002302217537863

158596 8 20  =>  37212476700442254614

359221 2 40  =>  1101111111001100010101100000110001110001

New tests:
----------

9 6 3  =>  144

10 6 3  =>  544

This is code-golf, so the shortest entry wins.

Mathematica, 57 48 bytes
Saved 9 bytes thanks to @2012rcampion .
IntegerString[#!/#2^#!~IntegerExponent~#2,##2]&


Print Every Code Golf tag Huge omega thanks to @wasif for emailing me this challenge idea in its basic form
Everyone knows that questions on StackExchange require tags - labels that allow posts to be grouped together by category. However, most of the time, I barely know which tags exist, because there's just so many of them.
Henceforth, today's task is to tell me every single tag that exists on the Code Golf and Coding Challenges Stack Exchange.
The Challenge
Write a program or function that prints/returns a list of all available tags on https://codegolf.stackexchange.com
As tags can be created/deleted at any time, simply hard-coding a list of tags is not a valid solution - the list must be correct at run-time regardless of when the program/function is executed.
The tags avaliable can be seen here
Rules

As this is an internet challenge, internet connections are allowed. However, web requests can only be made to codegolf.stackexchange.com and api.stackexchange.com domains.
Output can be given in any convenient and reasonable format.
The tags can be in any order, so long as all current tags are returned.
The exact name of the tags must be used (e.g. code-golf is valid, code GOLF is not valid.)
And as usual, standard loopholes apply, shortest code wins

Example Program
import urllib.request
import regex

pobj = regex.compile('rel="tag">(.*)</a>')
page_number = 2
req = urllib.request.urlopen(f"https://codegolf.stackexchange.com/tags?page=1&tab=name")
data = req.read().decode('utf-8')
tags = []
while data.count("tag") != 43:
    tags += pobj.findall(data)
    req = urllib.request.urlopen(f"https://codegolf.stackexchange.com/tags?page={page_number}&tab=name")
    data = req.read().decode('utf-8')
    page_number += 1

print(tags)

05AB1E, 60 57 bytes
[N>’¸¸.Â‚‹º.ŒŒ/›´?€¼=ƒËŠˆ&€®=ÿ’.wD2è'eQ#“e":"“¡¦ε'"¡н]\)˜

Beats all other answers.
[N>’...’.wD2è'eQ#“e":"“¡¦ε'"¡н]\)˜  # trimmed program
[               #                   # while...
            è                       # character in...
        .wD                         # data of response from URL...
                                    # (implicit) "http://" concatenated with...
   ’...’                            # "api.stackexchange.com/tags?site=codegolf&page=ÿ"...
                                    # (implicit) with ÿ replaced by...
 N                                  # current index in loop...
  >                                 # plus 1...
            è                       # at index...
           2                        # literal...
                #                   # is not...
               Q                    # equal to...
             'e                     # literal...
        .w                          # push data of response from URL...
                                    # (implicit) "http://" concatenated with...
   ’...’                            # "api.stackexchange.com/tags?site=codegolf&page=ÿ"...
                                    # (implicit) with ÿ replaced by...
 N                                  # current index in loop...
  >                                 # plus 1...
                      ¡             # split by...
                “e":"“              # literal...
                       ¦            # excluding the first...
                        ε           # with each element replaced by...
                            н       # first element of...
                                    # (implicit) current element in map...
                           ¡        # split by...
                         '"         # literal
                             ]      # exit map
                             ]      # exit infinite loop
                              \     # delete top element of stack
                               )    # push stack...
                                ˜   # flattened
                                    # implicit output


Rotor Routers on a Grid Input

Your input is a single string, separated by newlines into 2n+1 lines of length 2n+1, for some integer n ≥ 0. The integer n is not part of the input; you'll have to compute it from the string. The lines are composed of the "direction characters" >^<v. If newlines pose a problem, you can replace them by vertical pipes |.

The input forms a square grid of size (2n+1)x(2n+1), and each cell of the grid is interpreted as a rotor router, which points in one of the four cardinal directions. We proceed to drop a token on the router at the center of the grid, and then the routers will move it around in the following way. When the token lands on a router, the router turns 90 degrees in the counter-clockwise direction, and moves the token one step in the new direction it points to. If it lands on another router, the process is repeated, but eventually, the token will fall off the grid.

Output

Your output is the final configuration of the routers, in the same format as the input.

Example

As an example input, consider the 3x3 grid

<^<
^><
>^v

where the central router has been highlighted to indicate the token (it's a bit hard to see). The central router rotates to face north, and moves the token to the central cell of the top row:

<^<
^^<
>^v

This router rotates to face west, and sends the token to the top left corner:

<<<
^^<
>^v

The router in the corner sends the token south, so it's now at the leftmost cell of the middle row:

v<<
^^<
>^v

That router rotates to face west and sends the token off the grid.

v<<
<^<
>^v

This is the final grid configuration, so your program should output it. Note that in more complex examples, the token can pass the same router multiple times before falling off the grid.

Rules

You can write either a function or a full program. This is code-golf, so the lowest byte count wins. Standard loopholes are disallowed. You can decide whether there is a trailing newline in the input and/or output.

Test Cases

Input:
v
Output:
>

Input:
<^<
^><
>^v
Output:
v<<
<^<
>^v

Input:
>>^>>
v<vv<
>^>^<
^<>>^
vvv>>
Output:
>>^>>
>v>>v
^>>vv
^^>>>
v^<<^

Input:
<^^^^^^^^
<<^^^^^^>
<<<^^^^>>
<<<<^^>>>
<<<<^>>>>
<<<vv>>>>
<<vvvv>>>
<vvvvvv>>
vvvvvvvv>
Output:
>>>>>>>>v
^>>>>>>vv
^^>>>>vvv
^^^>>vvvv
<<<<<vvvv
^^^^<<vvv
^^^<<<<vv
^^<<<<<<v
^<<<<<<<<

CJam, 62 61 63 bytes

Try it online

Nq_N#):D;+_,2/{:P"^<v>^

"_P4$=#:X)=t_,0PX[1DW*WDSP]=-e>e<}h;1>

Expanded and commented:

Nq              "Read the input grid";
_N#):D;         "Calculate the vertical delta (line length + 1)";
+               "Prepend a newline to the grid";
_,2/            "Calculate the initial position as the length of the grid
                 string divided by 2";
{               "Do...";
  :P"^<v>^

"
  _P4$=           "Get the character indexed by the position in the grid";
  #:X             "Map the character to an operation number:
                   '^'=>0, '<'=>1, 'v'=>2, '>'=>3, '^'=>4, '\n'=>5, '\n'=>6
                   (the unreachable duplicate mappings are important below)";
  )=t             "Set the character indexed by the position in the grid to
                   the result of mapping the operation number + 1 backwards";
  _,0PX[1DW*WDSP]="Map the operation number to a negated delta (this occurs
                   after rotating routers, which means that operation n should
                   act like the character corresponding to operation n + 1):
                   0=>1, 1=>-delta, 2=>-1, 3=>delta, 5=>position";
  -e>e<           "Subtract the negated delta from the position and clamp it to
                   [0, length of the grid string] (array indices are circular,
                   so the length of the grid string will act like the index 0
                   and point to the initial newline next iteration, which will
                   *really* set the position to 0)";
}h              "... while the position is not 0 (i.e. not at the initial
                 newline)";
;1>             "Clean up and remove the initial newline";

My solution operates on the input as a flat string, so there's only one position value to keep track of and virtually no pre/postprocessing; there are only 2 bytes of preprocessing to add newline to the beginning of the grid and 2 bytes of postprocessing to remove it from the output. But these 4 bytes are well worth the cost as they let me keep newlines in and "execute" them like routers, but they "rotate" into another newline and set the position to zero. And the main loop ends when the position becomes zero.


Write code to determine the accepted answer Post an answer to this question that evaluates any answer to this question and determines whether it wins.
Who wins:

Winner is the answer that wins according to the most answers at 1700 UTC, Sunday, March 2nd.
You are welcome to and encouraged to change your own answer as the contest progresses.  Please do not change others'.
Ties are determined by the shortest code.
Regardless of how much sockpuppeting you might normally do, if something's fishy, I'm gonna disqualify you.
I will not accept my own answer, but I will use it to evaluate yours.

Rules:

Your calculation must provide a numeric score for any arbitrary answer (to make it easy, the input to your algorithm is either the id of the answer or the markdown of the answer on the page).
Your score must have at least one winner, and it must be possible for an answer besides yours to win.
Your algorithm cannot use something very specific to your answer, nor can username or timestamps be used at all.  I will be the final judge of what "very specific" means, but I encourage community policing and public shaming.
Your code must compile, run, and give a score given any answer.
Please include a link to a way to execute your code if it is not listed on Ideone.  See below.

R, 1 char

1

You can supply the id of an answer as a command line argument if you wish. :)
Link to ideone.

Further elaboration

Since it is not practical for an answers to execute other answers (different languages, etc.) and evaluate them based on their result the only remaining way I can see for them to give a score is to use some code metric.

I have noticed that all other answers so far give a higher score to shorter programs. I believe this is the shortest code possible so it should rank high in the result of other answers.

How and what answer my code gives for other answers seams to be less relevant. The only important aspect is that others rank my answer high.


Compute the shortest decimal representation of a IEEE 754 double-precision binary floating-point number Format

The format is a 64 bit value x representing a IEEE-754 double-precision binary floating-point number (a.k.a "a double"). x is assumed to represent a real number (not a NaN or Infinity).

Goal

The goal is to print/output the shortest string containing a decimal representation for which x is the closest IEEE 754 representation. Scientific notation is allowed. You can choose whether or not to allow a missing 0 in front of the ".".

x = 0x4000CCCCCCCCCCCD could be represented as "2.10000000000000008881784197001" but also as "2.1", which is much shorter. x = 0x3DDB7CDFD9D7BDBB can be represented as "1e-10" which is much shorter than alternative representation "1.0000000000000000364321973155E-10"

Rules

In addition to being correct, the program must run in a reasonable amount of time on a modern CPU, ruling out some forms of exhaustive search.

This being code-golf entries should be judged by concision, but voters should feel free to attribute points based on a discretionary judgment of elegance, and efficiency.

A few test cases

In these test cases, I represent the input as an hexadecimal number to make it clear that a IEEE 754 double 64 is passed. You can pass it as a double if the language supports it, or as a 64 bit integer, at your convenience.

f(0x4000CCCCCCCCCCCD) == "2.1"
f(0x3DDB7CDFD9D7BDBB) == "1e-10"
f(0x40934A456D5CFAAD) == "1234.5678" // N.B. not 1.2345678e3
f(0x3FEFFFFFFAA19C47) == "0.99999999"
f(0xC088A8CF13CEE9DD) == "-789.101112"`

C - 47 45 characters

Counting just the function f, and not including #includes and main.

In C, the %g fprintf specifier will always choose the shortest format. Add a precision specifier equal to the usual maximum precision of double and a bit of casting hocus-pocus to coerce int64 to double and Bob's your uncle.

#include <assert.h>
#include <stdint.h>
#include <stdio.h>

// The following line is what I'm counting...
f(int64_t u){printf("%.14g\n",*(double*)&u);}

int main()
{
    assert(sizeof(int64_t) == sizeof(double));

    f(0x4000CCCCCCCCCCCD);
    f(0x3DDB7CDFD9D7BDBB);
    f(0x40934A456D5CFAAD);
    f(0x3FEFFFFFFAA19C47);
    f(0xC088A8CF13CEE9DD);

    return 0;
}

Output is as per specs:

2.1
1e-10
1234.5678
0.99999999
-789.101112

Summary: C rocks!


Prison Architect, ASCII version Here is a diagram of a prison using ASCII characters:

+------------------------------+
|                              |
|   X               X          |
|                              |
|                              D
D                              |
|                              |
|                              |
|        X           X   X     |
|                              |
+------------------------------+

Walls are made out of pipe characters |, dashes -, and pillars + for corners and intersections. There are also two doors marked with D (which will always be on the left and right walls). The prison is filled with scary people marked with X.

The goal is to build walls to satisfy the following:

Each person is in solitary confinement;
There is a corridor running between the two doors;
Each cell contains exactly one door, which is directly connected to the main corridor;
All space in the prison is used by the cells and the corridor;
Each cell contains a person (that is, there are no empty cells).

The corridor is a single path, doesn't branch off, and is always one character wide. Here's a solution for the prison above:

+---------+--------------------+
|         |                    |
|   X     |         X          |
|         |           +--------+
+------D--+-----D-----+        D
D                       +---D--+
+----D--------+---D-----+      |
|             |         |      |
|        X    |      X  |X     |
|             |         |      |
+-------------+---------+------+

You can assume that any input prison will always have a valid output. Here are some more input prisons, along with possible outputs:

+------------------------------+
|X X X X X X X X X X X X X X X |
|                              |
D                              D
|                              |
|              X               |
+------------------------------+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+
|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X |
+D+D+D+D+D+D+D+D+D+D+D+D+D+D+D-+
D                              D
+----------------------D-------+
|              X               |
+------------------------------+

+-----------+
|X          |
|           |
|           |
|X         X|
|           |
|          X|
|           |
D           D
+-----------+

+-+-------+-+
|X|       D |
| D +---+ | |
+-+ |     | |
|X| | +---+X|
| | | |   +-+
| D | |    X|
+-+ | +-D---+
D   |       D
+---+-------+

+----------------+
|X    X    X    X|
|                |
D                |
|                |
|X    X    X     |
|                |
|                |
|                |
|     X    X     D
|                |
|                |
+----------------+

+---+---+----+---+
|X  | X |  X |  X|
+--D+--D+---D+--D+
D                |
+---+---+------+ |
|X  | X |  X   | |
+--D+--D+---D--+ |
|                |
| +-----+------+-+
| |   X |  X   | D
| +----D+---D--+ |
|                |
+----------------+

Python 2, 2986 2881 2949 2135 2075 2071 1996 bytes

Saved 105 bytes, implemented the program as a function to comply with standard rules. Implemented Wheat Wizard's tab and space suggestion.
Added 68 bytes due to fixing a bug.
Saved 814+51 bytes thanks to Halvard Hummel.
Saved 9+4 bytes.
Saved 4 bytes thanks to Erik the Outgolfer.
Saved 71 bytes thanks to ppperry's suggestion.

exec r"""def Z(P):
 H,n,I,o,O,i,d,D,W=[type,range]+list(" dD#xX*");R=(1,0),(-1,0),(0,1),(0,-1)
 def F(j,k,l):P[j][k]=l
 def E(j,k,v,w):
	if G(j,k,v):F(k,j,w)
 def q(b,c,d):[[E(j+J,k+K,b,c)for J,K in M]&L if G(j,k,d)]
 def A(e,r,l,o,q):
	S,E,P[q][o],Q,X=P[q][o],e,0,[(o,q)],0
	for a,b in Q:
	 &R:
		x,y=a+j,b+k
		if(0<=x<w!=0<=y<h)<1:continue
		if e in((x,y),P[y][x]):X=1;e=x,y;break
		if I!=P[y][x]:continue
		F(y,x,P[b][a]+1);Q+=[(x,y)]
	 if X:break
	p,i=e,0
	while(o,q)!=p:
	 a,b=p;P[b][a],m=[r,l][l and i==1],0
	 &R:
		x,y=a+j,b+k
		if(0<=x<w!=0<=y<h)-1:continue
		if(H(P[y][x])==H(0))*(m==0 or P[y][x]<P[m[1]][m[0]]):m=x,y
	 p=m;i+=1
	P[q][o],P[e[1]][e[0]]=S,E;[F(k,j,I)&L if H(P[k][j])==H(0)]
 def B(N):
	[[E(j,k,"x*",I),0<j<w-1 and E(j,k,O,I)]&L]
	&L:
	 if G(j,k,D):[E(j+J,k+K,I,d)for J,K in M]
	 if G(j,k,O)and j==0:T=0,k
	if N:A(O,o,0,*T)
	U,V=M[-1];[[[F(k+K,j+J,I)for J,K in M if(P[k+K][j+J]!=i)*((0<=j+J+U<w!=0<=k+K+V<h and G(j+J+U,k+K+V,D))<1)],F(k,j,W),A(o,W,O,j,k),q(I,d,W),F(k,j,D)]&L if G(j,k,D)];q("xX*# @+-|",i,o)
 for j in"|+-":P=P.replace(j,i)
 P=list(map(list,P.split("\n")));h=len(P);w=len(P[0]);b,L,M,G="#+-|D",[(k,j)for k in n(w)for j in n(h)],[(k-1,j-1)for k in n(3)for j in n(3)if(j,k)!=(1,1)],lambda j,k,v:P[k][j]in v
 B(1);Y=lambda:0<j<w-1!=0<k<h-1and G(j,k,i);[[[F(k,j,o),F(k+g,j+N,i)]for N,g in((-1,-1),(-1,1),(1,-1),(1,1))if P[k][j+g]+P[k][j-g]==P[k+N][j+g]+P[k-N][j]==P[k+N][j]+i==o+i]&L if(j in(1,w-2)or k in(1,h-2))*Y()for N in n(w*h)];[F(k,j,I)&L if Y()];B(0)
 def c(x,y,b,l,d,f,Q):
	F(y,x,b)
	for J,K in M:Q+=[[],[(x+J,y+K)]][G(x+J,y+K,l)];E(x+J,y+K,d,f)
 &L:
	if G(j,k,D):Q=[(j,k)];[c(x,y,"@",W,d,I,Q)for x,y in Q if G(x,y,"X*")];[G(u,v,"X*")and[E(u+U,v+V,I,d)for U,V in M]or E(u,v,"@",I)for u,v in L];Q=Q[:1];[c(x,y,"$",I,"x*",i,Q)for x,y in Q];F(k,j,D)
 &L:E(j,k,"@$d",I);X=(k>0and G(j,k-1,b))+(k<h-1and G(j,k+1,b))-(j>0and G(j-1,k,b))-(j<w-1and G(j+1,k,b));E(j,k,i,{2:"+",X:"|",-X:"-"}[2])
 print"\n".join("".join(p)for p in P)""".replace("&","for j,k in ")

Try it online!

It was golfed down significantly; yet there may still be room for improvement. This piece of code, however, solves all test cases. Does not run very efficiently; for large prisons the architect may take their time to figure it out.
Uses a simple pathfinding algorithm to connect both doors and the prisoners to the corridor. Then it encapsulates all prisoners and their walls and pushes said walls in empty space until all of it is filled. As a final step, the ASCII art appearance is implemented.

Took me for sure several hours to write. I hope it also works on other prisons than the test cases. (You cannot test them all, can you?)


Partial sums of the Kempner series The Kempner series is a series that sums the inverse of all positive integers that don't contain a "9" in their base-10 representations (i.e., \$\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + .. + \frac{1}{8} + \frac{1}{10} + ...\$).
It can be shown that, unlike the Harmonic series, the Kempner series converges (to a value of about 22.92067661926415034816).
Your task is to find the partial sums of the Kempner series. These are the ways you can do it:

Take a number \$n\$, and return the sum of the inverse of the first \$n\$ numbers that don't have a "9" in them, which is the \$n\$th partial sum of the series.
Take a number \$n\$, and return the first \$n\$ partial sums of the series.
Don't take any input and output the partial sums infinitely.

You can choose if your input is 0-indexed or 1-indexed.
Your algorithm result's distance from the correct value may not be over \$10^{-4}\$, for all possible values of \$n\$. While your algorithm should work theoretically for all values for N, you may ignore inaccuracies coming from floating-point errors.
Test cases, in case of returning the \$n\$th partial sum, 0-indexed:
0 -> 1.0
1 -> 1.5
9 -> 2.908766...
999 -> 6.8253...

Standard loopholes are disallowed.
This is code-golf, so the shortest answer in bytes wins.

Jelly, 7 6 bytes
Rb9ḌİS

Try it online!
-1 byte thanks to @Razetime
Takes input 1-indexed as an argument (footer on TIO converts to 0-indexed like in test cases)
Returns the nth partial sum
How it Works
Let's look at the denominators in base 10:
\$[1, 2, 3, 4, 5, 6, 7, 8, 10,11,12,13,...]\$ (base 10)
Since these consist of the nine base-9 digits, we can interpret them as  base 9 strings:
\$[1_9, 2_9, 3_9, 4_9, 5_9, 6_9, 7_9, 8_9, 10_9, 11_9, 12_9, 13_9, ...]\$
\$=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]\$ (base 10)
So all of the denominators can be generated as natural numbers, converted to base 9, then interpreted as base 10.
Rb9ḌİS - main link, taking n (1-indexed)
R       - convert to list [1..n]
 b9     - convert each natural number to base 9
   Ḍ   - interpret each base-9 string as base 10 (decimal)
    İ  - reciprocal
     S - sum


Shortest Unique Substrings Input

An alphanumeric string s.

Output

The shortest string that occurs exactly once as a (contiguous) substring in s.
Overlapping occurrences are counted as distinct.
If there are several candidates of the same length, you must output all of them in the order of occurrence.
In this challenge, the empty string occurs n + 1 times in a string of length n.

Example

Consider the string

"asdfasdfd"

The empty string occurs 10 times in it, so it is not a candidate for unique occurrence.
Each of the letters "a", "s", "d", and "f" occurs at least twice, so they are not candidates either.
The substrings "fa" and "fd" occur only once and in this order, while all other substrings of length 2 occur twice.
Thus the correct output is

["fa","fd"]

Rules

Both functions and full programs are allowed, and standard loopholes are not.
The exact formatting of the output is flexible, within reason.
In particular, producing no output for the empty string is allowable, but throwing an error is not.
The lowest byte count wins.

Test cases

"" -> [""]
"abcaa" -> ["b","c"]
"rererere" -> ["ererer"]
"asdfasdfd" -> ["fa","fd"]
"ffffhhhhfffffhhhhhfffhhh" -> ["hffff","fffff","hhhhh","hfffh"]
"asdfdfasddfdfaddsasadsasadsddsddfdsasdf" -> ["fas","fad","add","fds"]

Leaderboard

Here's the by-language leaderboard that I promised.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

# Ruby, <s>104</s> <s>101</s> 96 bytes

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>site = 'meta.codegolf',postID = 5314,isAnswer = true,QUESTION_ID = 45056;jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)<\\/code><\/pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

Python 3, 124 123 111 96 bytes
f=lambda s,n=1:[x for x in[s[i:i+n]for i in range(len(s)+1)]if s.find(x)==s.rfind(x)]or f(s,n+1)

Looks for strings such that the first occurrence from the left is the same as the first occurrence from the right. The +1 in the range is to accommodate for the empty string case.
Now if only Python had a .count() which counted overlapping matches, then this would have been a fair bit shorter.


The world is like a Mirror: smile and it'll sɯıןǝ qɐɔʞ Input:

A string only containing the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.?! (space at the end) and two special characters (_ and |)

Output:

Mirror the text based on the position(s) of the _ and |.
_ mirrors horizontally and | mirrors vertically.

Mirroring process

The first _ indicates the start of the mirroring of that substring, the second _ the end.
If just one _ is present, you can continue on until the end of the string.
If more then two _ are present, the same process repeats.
There can only be one | in the string, and this reversed the first substring and removes the second substring.

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.?! (space at the end) will be converted to ɐqɔpǝɟɓɥıɾʞlɯuodbɹsʇnʌʍxʎz∀ƆᗡƎℲ⅁HIſ⋊⅂WNOԀΌᴚS⊥∩ΛMX⅄Z0⇂ᘔƐ߈ϛ9ㄥ86˙¿¡ (space at the end) when it is mirrored by _ (click the link for the unicode values - requires unicode v8.0+).

Example input 1: _Will I be mirrored?!
Output 1: Mıll I qǝ ɯıɹɹoɹǝp¿¡

Example input 2: Wi_ll I be mi_rrored?!
Output 2: Will I qǝ ɯırrored?!

When it is mirrored by | we simply reverse the substring from 0 to index-of-|.

Example input 1: Will I be mirror|ed?!
Output 1: Will I be mirrorrorrim eb I lliW

Both mirrors (_ and |) can be present in the string.

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

Test cases:

_Will I be mirrored?!                          ->   Mıll I qǝ ɯıɹɹoɹǝp¿¡
Wi_ll I be mi_rrored?!                         ->   Will I qǝ ɯırrored?!
Will I be mirror|ed?!                          ->   Will I be mirrorrorrim eb I lliW
This_ is a test_ cont_aining bo|t_h mirrors.   ->   This ıs ɐ ʇǝsʇ contɐıuıuɓ qooq ɓuıuıɐtnoc ʇsǝʇ ɐ sı sihT
0_1_2_3_4_5|_6_7_8_9                           ->   0⇂2Ɛ4ϛϛ4Ɛ2⇂0

Pyth - 174 bytes
Can prolly save with base compression or something cuz of unicode(this is only 119 chars)
u?qH\_&=hZG+G@@c2K+s+rB;1UT".?! ɐqɔpǝɟɓɥıɾʞlɯuodbɹsʇnʌʍxʎz∀ƆᗡƎℲ⅁HIſ⋊⅂WNOԀΌᴚS⊥∩ΛMX⅄Z0⇂ᘔƐ߈ϛ9ㄥ86˙¿¡ "ZxKH?}\|zs_Bhcz\|zk

Test Suite.


Plus or minus polyglots! Your submission must take a list of numbers (in whatever list format your language supports, or using multiple function / command-line parameters) or a string of numbers separated by any character that is not 0123456789. In one language, it must add all of them and output the sum. In another language, it must output them subtracted from each other in order. Example:

12
5
7
2

In one language, it must output 26, and in another it must output -2. Note that all numbers inputted will be positive integers less than 100. There will never be more than 20 numbers provided, so you will never output greater than 2000 or less than -1899. Any questions? Comment below!

Python 2 / 3, 52 bytes

lambda l:sum(l[:1]+[x*int(1-(1/2)*4)for x in l[1:]])

int(1-(1/2)*4) returns 1 in Python 2 because 1/2 evaluates first to 0, and then 0 * 4 = 0.

int(1-(1/2)*4) returns -1 in Python 3 because 1/2 evaluates first to 0.5, and then int(0.5 * 4) = int(2.0) = 2.


The Original Number (II) This challenge is essentially identical to this one with just one difference: it is now allowed to shuffle letters anywhere in the string.
Scenario
John has an important number, and he doesn't want others to see it.
He decided to encrypt the number, using the following steps:
His number is always a non-decreasing sequence (ie. "1123")
He converted each digit into English words. (ie. "123" -> "ONETWOTHREE")
And then, rearrange the letters randomly. (ie. "ONETWOTHREE" -> "EEWOOHRNTET")
John felt that his number were safe in doing so. In fact, such encryption can be easily decrypted :(

Task
Given the encrypted string s, your task is to decrypt it and return the original number.

Rules

This is code golf, so the shortest answer in bytes wins
You can assume that the input string is always valid
The input string only contains uppercase letters
The original numbers are always arranged in ascending order
You may return the number in string or integer format
The letters will only be shuffled between one word, not between the whole string. The letters can be shuffled anywhere in the string.
The numbers will only be from 1 to 9 inclusive (ONE to NINE)

Possible Unscrambled String
Here is a list of the strings just after they have been converted to strings from the numbers:
 1 -> ONE
 2 -> TWO
 3 -> THREE
 4 -> FOUR
 5 -> FIVE
 6 -> SIX
 7 -> SEVEN
 8 -> EIGHT
 9 -> NINE

Examples
"NEO" -> 1
"NWEOOT" -> 12
"TOEERWNEHOT" -> 123
"IHNEVGENNEISTE" -> 789
"WEETVTRFSVUHNEEFRHIXEOINSNIEGTOONIEE" -> 123456789
"EWHEWROETOTTON" -> 1223
"ONEWESTV" -> 27 (thanks, ETHproductions!)

Python 2, 123 bytes
c=map(input().count,"OWHUFXSGIQ")
i=4
for j in"71735539994":c[i*2]-=c[int(j)];i=-~i%5
s=""
for n in c:i+=1;s+=`i`*n
print s

A full program taking quoted input and printing John's number.
Try it online! or see a test-suite
How?
Let's work with the example "NEONSEXTOWNII" (to yield 1269, and be somewhat Leisure Suite Larry-esque!)
First c=map(input().count,"OWHUFXSGIQ") takes input and counts the number of each of OWHUFXSGIQ - these are letters that appear in each number in ascending order, with 2,4,6, and 8 having their "own" letters (WUXG), plus an extra letter, Q to append a zero to the the end and make the length of the resulting list even. For the example:
[2,1,0,0,0,1,1,0,2,0] <- c
 O W H U F X S G I Q  <- is the counts of these letters
 1 2 3 4 5 6 7 8 9 0  <- which "relate to" these digits in John's number
   2   4   6   8   0  <- these will be correct as the letters are unique to their words

The entries for 1, 3, 5, 7, and 9 need adjusting to correct the abundance of the other letters. This is performed by the next loop:
i=4
for j in"71735539994":c[i*2]-=c[int(j)];i=-~i%5

Note that the entries to adjust are alternate ones (1,3,5,7,9,1,3,5,...), so we can add two to an index variable at each step and modulo by 10 to stay in range if we need to traverse more than once (which we do). To save some bytes we can increment by one and modulo by 5 and use double the index.
Since the adjustments for 9 require the most work we start there - it resides at index 8 so we start at i=4.
The string "71735539994" then gives the indexes, j, of the values to remove at each stage (where we have ensured the ninth index will contain zero by using "Q" when creating c); c[i*2]-=c[int(j)] performs each individual adjustment and i=-~i%5 moves i to the next index (where -~i is -(-1-i) or i+1 saving parentheses (i+1)%5) keeping i*2 within the bounds of c.
Thus we first subtract the number at index j=7 from that at index i*2=8, subtracting the number of "G"s counted from the number of "I"s, adjusting the "NINE" count down by the (correct) number of "EIGHT"s (which also has an "I"). We then move onto i=0 (-~4%5 = (4+1)%5 = 0), referencing index i*2 = 0 which is for "ONE" and subtract the value found at index j=1 the entry counting "W" and hence "TWO", adjusting the count of "O"s down. By the end of the loop we have the corrected counts:
[1,1,0,0,0,1,0,0,1,0] <- c   (for 1223333448 it would be: [1,2,4,2,0,0,0,1,0,0])
 1 2 3 4 5 6 7 8 9 0

so all that remains is to print out what c now represents (1269). i is now back at 0, so we increment it at the start of the loop and use it as our digit:
s=""
for n in c:i+=1;s+=`i`*n
print s

The back ticks, `i`, are Python2 shorthand for repr(i) which gets a string representation of an object (the digit character in question as a string) and multiplying a string by a number creats a new string of that many repeats (here we only show n=0 turning `i` from say "5" to "" and n=1 turning keeping say "6" as "6", but it also works for larger positive integers, so "3"*4 becomes "3333" for example.)


C# is the Main problem This programming puzzle is inspired by another question which has been asked here yesterday but which was deleted by the author...

The challenge:

Create an executable binary (Windows .EXE or Linux binary) using Visual C# (or your favorite C# IDE) which prints the following text to the standard output:

Main() is the main method of C# programs!

... without using the 4 consecutive letters M-A-I-N appearing in any source file!

Notes:

If your source code contains the text remainder (for example) it contains the 4 consecutive letters M-A-I-N, however if it contains mxain the 4 letters would not be consecutive any more so mxain would be allowed.
You are not allowed to run any programs but the C# IDE nor change the settings of the C# IDE to run other programs (but the ones it would normally run such as the C# compiler).

Otherwise you could simply say: "I write a Pascal program using the C# IDE and invoke the Pascal compiler in the 'pre-build' steps of my C# project".

This would be too simple.
Users of an IDE that can be extending using "plug-ins" (or similar) or that have built-in binary file editors (hex-editors) would have a too large advantage over users of other C# IDEs.

Therefore these featrues should also not be used.
Using the other non-ASCII-Editors (such as the dialog window editor) is explicitly allowed!
The user asking the original question proposed using the backslash in function names just like this: static void M\u0061in() Because this answer has already been read by other users it will not be accepted any more!
A user asked if it would be allowed to simply type in an .EXE file into the source code editor and to save the file as ".exe" instead of ".cs". Answer: I doub't that this is possible because both valid Windows and Linux binaries contain NUL bytes. However if you find a valid binary that can be created this way you have a valid solution.

The name of this site is "Programming Puzzles & Code Golf" - this is a "Programming Puzzle", not "Code Golf": The challenge is to find a working solution before all other users, not to find a solution shorter than all other solutions.

Therefore the first post describing a working solution wins!

Good luck!

By the way: I have a solution working under Visual C# Express 2010.

C# Interactive Window
Open the C# Interactive Window (View > Other Windows > C# Interactive in Visual Studio 2015). I suppose not all IDEs will have this.
This approach executes C# in the Interactive Window in order to create a C# exe that prints the desired string without the author ever writing main. As a bonus, the exe's IL also does not contain main.
Run the following code in the Interactive Window
using System.Reflection;
using System.Reflection.Emit;
var appMeow = (dynamic)System.Type.GetType("System.AppDom" + "ain").GetProperty("CurrentDom" + "ain", BindingFlags.GetProperty | BindingFlags.Static | BindingFlags.Public).GetValue(null);
var asmName = new AssemblyName("MEOW");
var asmBuilder = appMeow.DefineDynamicAssembly(asmName, AssemblyBuilderAccess.RunAndSave);
var module = asmBuilder.DefineDynamicModule("MEOW", "MEOW.exe");
var typeBuilder = module.DefineType("Meow", TypeAttributes.Public);
var entryPoint = typeBuilder.DefineMethod("EntryPoint", MethodAttributes.Static | MethodAttributes.Public);
var il = entryPoint.GetILGenerator();
il.Emit(OpCodes.Ldstr, "Meow() is the meow method of C# programs!");
il.Emit(OpCodes.Ldstr, "eow");
il.Emit(OpCodes.Ldstr, "ain");
il.EmitCall(OpCodes.Call, typeof(string).GetMethod("Replace", new[] { typeof(string), typeof(string) }), null);
il.EmitCall(OpCodes.Call, typeof(Console).GetMethod("Write", new[] { typeof(string) }), null);
il.Emit(OpCodes.Ret);
var type = typeBuilder.CreateType();
asmBuilder.SetEntryPoint(type.GetMethods()[0]);
asmBuilder.Save("MEOW.exe");

Use Environmnent.CurrentDirectory to see where the exe was created. Run it to observe the desired output.

Resulting IL:


Output the van der Corput sequence The van der Corput sequence is one of the simplest example of low-discrepancy sequence. Its n-th term is just 0.(n written in base 10 and mirrored), so its first terms are :

0.1, 0.2,0.3,0.4, 0.5,0.6,0.7, 0.8,0.9,
0.01, 0.11,0.21,0.31, 0.41,0.51,0.61, 0.71,0.81,0.91,
0.02, 0.12,0.22,0.32, 0.42,0.52,0.62, 0.72,0.82,0.92, ...

The challenge

Write a program or a function in any programming language that takes as input a positive integer n less than 10^6 and returns or print the first n terms of the van der Corput sequence. The output format can be a list of floating point numbers, a list of strings of the form 0.digits, or a unique string where the terms are separated by commas and/or whitespaces, newlines.

Standard loopholes are forbidden. The shortest source code wins.

05AB1E, 6 bytes
Code:
>GNÞR,

Try it online!
Explanation:
>       # Increment, pushes input + 1
 G      # For N in range(1, input + 1):
  N     # Push N
   Þ    # Convert to double, which appends `.0` at the end of an integer
    R   # Reverse top of the stack
     ,  # Pop and print with a newline

Uses CP-1252 encoding.


All Light All Light All Light! This challenge is completely ripped offheavily inspired by All Light, developed by Soulgit Games.

Challenge

You are an electrician, and it's your job to wire up all the lights to the battery.

The lights and battery are laid out in a grid.
You can connect a light or battery to the nearest light or battery to its north, south, east, and west.
The battery can have any number of connections.
Each light specifies how many connections it requires. You must make exactly that many connections to that light.
You can create single connections or double connections between two lights (or light and battery).
Wires cannot cross.
There must be a path from each light to the battery.
At least one valid solution is guaranteed to exist.

Given the position of the battery and each light, and the number of connections each light requires, output the connections between them that admit these properties.

Win Condition

This is code-golf, so the shortest code in each language wins.

Test Cases

I/O is flexible as usual.

For input I will be using a 2d array the size of the grid which stores positive integers for lights, zeros for blank spaces, and -1 for the battery. Another good choice might be a list of lights, where a light is a tuple containing the light's position and number of required connections.

For output I will be using a list of connections, where a connection is a tuple containing the starting position and ending position. If a connection is doubled then I will have 2 of them in the list (another option is to include this parameter in the tuple). Another good option could be some sort of grid layout.

If you are using a coordinate system you may specify the starting index and where you index from. My examples will be 0-indexed and use (0, 0) as the top left corner (row, column). (I am using {} simply to introduce another type of delimiter so it is easier to read, not because they are sets.)

Here is a graphical view of the test cases: Tests 1-12

Test 1:

[-1 | 0 | 1 ] => [{(0, 0), (0, 2)}]

Test 2:

[-1 | 0 | 2 ] => [{(0, 0), (0, 2)}, {(0, 0), (0, 2)}]

Test 3:

[-1 ]
 [ 0 ] => [{(0, 0), (2, 0)), ((0, 0), (2, 0)}]
 [ 2 ]

Test 4:

[ 1 | 0 |-1 | 0 | 2 ] => [{(0, 0), (0, 2)}, {(0, 2), (0, 4)}, {(0, 2), (0, 4)}]

Test 5:

[ 2 ]
[ 0 ]
[-1 ] => [{(0, 0), (2, 0)}, {(0, 0), (2, 0)}, {(2, 0), (4, 0)}]
[ 0 ]
[ 1 ]

Test 6:

[ 1 | 0 | 0 ]
[ 0 | 0 | 0 ] => [{(0, 0), (2, 0)}, {(2, 0), (2, 2)}]
[ 2 | 0 |-1 ]

Test 7:

[ 4 | 0 | 0 |-1 ]
[ 0 | 0 | 0 | 0 ] => [{(0, 0), (0, 3)}, {(0, 0), (0, 3)},
[ 2 | 0 | 0 | 0 ]     {(0, 0), (3, 0)}, {(0, 0), (3, 0)}]

Test 8:

[ 2 | 0 |-1 | 0 | 2 ]   [{(0, 0), (0, 2)}, {(0, 0), (0, 2)},
[ 0 | 0 | 0 | 0 | 0 ] =>  {(0, 2), (0, 4)}, {(0, 2), (0, 4)},
[ 0 | 0 | 1 | 0 | 0 ]     {(0, 2), (2, 2)}]

Test 9:

[ 0 | 0 | 2 | 0 | 0 ]
[ 0 | 0 | 0 | 0 | 0 ]
[ 1 | 0 |-1 | 0 | 1 ] => [{(0, 2), (2, 2)}, {(0, 2), (2, 2)}, {(2, 0), (2, 2)},
[ 0 | 0 | 0 | 0 | 0 ]     {(4, 2), (2, 2)}, {(2, 4), (2, 2)}, {(2, 4), (2, 2)}]
[ 0 | 0 | 2 | 0 | 0 ]

Test 10:

[-1 | 2 | 3 | 2 ] => [{(0, 0), (0, 3)}, {(0, 0), (0, 3)},
                       {(0, 0), (0, 3)}, {(0, 0), (0, 3)}]

Test 11:

[-1 | 0 | 0 | 0 ]
[ 3 | 0 | 0 | 0 ]
[ 3 | 0 | 0 | 3 ] => [{(0, 0), (1, 0)}, {(1, 0), (2, 0)}, {(1, 0), (2, 0)},
[ 0 | 0 | 0 | 0 ]     {(2, 0), (2, 3)}, {(2, 3), (4, 3)}, {(2, 3), (4, 3)}]
[ 0 | 0 | 0 | 2 ]

Test 12:

[ 2 | 0 | 0 ]   [{(0, 0), (1, 0)}, {(0, 0), (1, 0)}, {(1, 0), (1, 1)},
[ 3 |-1 | 0 ] =>  {(1, 1), (2, 1)}, {(1, 1), (2, 1)}, {(2, 0), (2, 1)},
[ 2 | 5 | 1 ]     {(2, 0), (2, 1)}, {(2, 1), (2, 2)}]


Close neighbours stick together Given a list of positive digits, return that list with consecutive elements grouped together. For example:
[1, 2, 3, 5, 6, 5, 4, 4, 1] -> [[1, 2, 3], [5, 6, 5, 4], [4], [1]]

Essentially, all adjacent elements whose absolute difference is 1 should be grouped together.
The input array will only ever contain positive digits (123456789) and it's length will always fit within your language's integer limit. You may take input in any reasonable format, including as a string or a single integer (so the example would be \$123565441\$). The input will never be empty and will always contain at least 1 element
You may output in any reasonable format that clearly shows the separate groups. There must be clear, non-digit delimiters between the groups. There doesn't have to be clear delimiters between the elements of the groups. If there are, the delimiters between groups and the elements of groups should be distinct (basically, you can't just print the input saying that both are separated by ,  or whatever).
One example output is shown above. Another could be outputting each group on a separate line, as single strings of digits such as
123
5654
4
1

The input is not guaranteed to be sorted. The order of the outputs, or the elements in the outputs, does not have to match the order of the inputs, so long as the groups and elements are correct.
This is code-golf so the shortest code in bytes wins.
Test cases
[1] -> [1]
[1, 2] -> [[1, 2]]
[1, 3] -> [[1], [3]]
[2, 1] -> [[2, 1]]
[2, 4, 1, 2, 7, 6, 5, 1] -> [[2], [4], [1, 2], [7, 6, 5], [1]]
[4, 1, 8, 1, 3, 5, 3, 7, 1] -> [[4], [1], [8], [1], [3], [5], [3], [7], [1]]
[1, 2, 3, 4, 5, 6, 7, 9, 8] -> [[1, 2, 3, 4, 5, 6, 7], [9, 8]]
[1, 2, 3, 5, 6, 5, 4, 4, 1] -> [[1, 2, 3], [5, 6, 5, 4], [4], [1]]
[6, 1, 4, 4, 1, 2, 1, 4, 3, 2, 9, 2, 7, 5, 7, 3, 1, 7, 6, 5] -> [[6], [1], [4], [4], [1, 2, 1], [4, 3, 2], [9], [2], [7], [5], [7], [3], [1], [7, 6, 5]]
[6, 1, 4, 4, 1, 2, 3, 4, 3, 2, 9, 2, 7, 5, 7, 3, 1, 7, 6, 5] -> [[6], [1], [4], [4], [1, 2, 3, 4, 3, 2], [9], [2], [7], [5], [7], [3], [1], [7, 6, 5]]

J, 17 bytes
<;.1~1,1~:&|2-/\]

Try it online!
Thanks to rak for pointing out that repeated elements should start a new group

2-/\] Take successive deltas
1~:&| Is the absolute value not equal to 1?
1, Append one (since first element always starts a new group)
<;.1~ Group by that mask (ie, start new group every time there's a one)


New Order #5: where Fibonacci and Beatty meet at Wythoff Introduction (may be ignored)

Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. This is the fifth challenge in this series (links to the first, second, third and fourth challenge).

In this challenge, we will meet the Wythoff array, which is a intertwined avalanche of Fibonacci sequences and Beatty sequences!

The Fibonacci numbers are probably for most of you a well known sequence. Given two starting numbers \$F_0\$ and \$F_1\$, the following \$F_n\$ are given by: \$F_n = F_{(n-1)} + F_{(n-2)}\$ for \$n>2\$.

The Beatty sequence, given a parameter \$r\$ is: \$B^r_n = \lfloor rn \rfloor\$ for \$n \ge 1\$. One of the properties of the Beatty sequence is that for every parameter \$r\$, there is exactly one parameter \$s=r/(r-1)\$, such that the Beatty sequences for those parameters are disjunct and joined together, they span all natural numbers excluding 0 (e.g.: \$B^r \cup B^{r/(r-1)} = \Bbb{N} \setminus \{0\}\$).

Now here comes the mindblowing part: you can create an array, where each row is a Fibonacci sequence and each column is a Beatty sequence. This array is the Wythoff array. The best part is: every positive number appears exactly once in this array! The array looks like this:

   1    2    3    5    8   13   21   34   55   89  144 ...
   4    7   11   18   29   47   76  123  199  322  521 ...
   6   10   16   26   42   68  110  178  288  466  754 ...
   9   15   24   39   63  102  165  267  432  699 1131 ...
  12   20   32   52   84  136  220  356  576  932 1508 ...
  14   23   37   60   97  157  254  411  665 1076 1741 ...
  17   28   45   73  118  191  309  500  809 1309 2118 ...
  19   31   50   81  131  212  343  555  898 1453 2351 ...
  22   36   58   94  152  246  398  644 1042 1686 2728 ...
  25   41   66  107  173  280  453  733 1186 1919 3105 ...
  27   44   71  115  186  301  487  788 1275 2063 3338 ...
  ...

An element at row \$m\$ and column \$n\$ is defined as:

\$A_{m,n} = \begin{cases}
\left\lfloor \lfloor m\varphi \rfloor \varphi \right\rfloor & \text{ if } n=1\\
\left\lfloor \lfloor m\varphi \rfloor \varphi^2 \right\rfloor & \text{ if } n=2\\
A_{m,n-2}+A_{m,n-1} & \text{ if }n > 2
\end{cases}\$

where \$\varphi\$ is the golden ratio: \$\varphi=\frac{1+\sqrt{5}}{2}\$.

If we follow the anti-diagonals of this array, we get A035513, which is the target sequence for this challenge (note that this sequence is added to the OEIS by Neil Sloane himself!). Since this is a "pure sequence" challenge, the task is to output \$a(n)\$ for a given \$n\$ as input, where \$a(n)\$ is A035513.

There are different strategies you can follow to get to \$a(n)\$, which makes this challenge (in my opinion) really interesting.

Task

Given an integer input \$n\$, output \$a(n)\$ in integer format, where \$a(n)\$ is A035513.

Note: 1-based indexing is assumed here; you may use 0-based indexing, so \$a(0) = 1; a(1) = 2\$, etc. Please mention this in your answer if you choose to use this.

Test cases

Input | Output
---------------
1     |  1
5     |  7
20    |  20
50    |  136
78    |  30
123   |  3194
1234  |  8212236486
3000  |  814
9999  |  108240
29890 |  637

It might be fun to know that the largest \$a(n)\$ for \$1\le n\le32767\$ is \$a(32642) = 512653048485188394162163283930413917147479973138989971 = F(256) \lfloor 2 \varphi\rfloor + F(255).\$

Rules

Input and output are integers
Your program should at least support input in the range of 1 up to 32767). Note that \$a(n)\$ goes up to 30 digit numbers in this range...
Invalid input (0, floats, strings, negative values, etc.) may lead to unpredicted output, errors or (un)defined behaviour.
Default I/O rules apply.
Default loopholes are forbidden.
This is code-golf, so the shortest answers in bytes wins

R, 143 130 124 123 bytes

function(n){k=0:n+1
`~`=rbind
m=k-1~(k*(1+5^.5)/2)%/%1
for(i in k)m=m~m[i,]+m[i+1,]
m=m[-1:-2,]
m[order(row(m)+col(m))][n]}

Try it online!

Uses the formula \$T(n,-1)=n-1; T(n,0)=\lfloor n\cdot\phi\rfloor;T(n,k)=T(n,k-1)+T(n,k-2)\$ to construct the array (transposed), then splits the array along antidiagonals. k merely exists to prevent forcing a drop=F argument in m[-1:-2,] for the case n=1.

Thanks to Neil for pointing out a 1 byte golf.

R, 150 138 132 bytes

function(n){T[2]=1
for(j in 2:n-1)T=c(T,T[j]+T[j+1])
m=T[-1]%o%((1:n*(.5+5^.5/2))%/%1)+T[-1-n]%o%(1:n-1)
m[order(row(m)+col(m))][n]}

Try it online!

Implements the formula \$T(n,k)=Fib(k+1)\cdot\lfloor n\cdot\phi\rfloor+Fib(k)\cdot(n-1)\$ to get generate the array, then splits along the antidiagonals and extracts the nth element.

Thanks to Robin Ryder for the T[2]=1 trick for generating the Fibonacci sequence.

Both solutions are highly inefficient, creating an nxn matrix of (most likely) doubles, as R promotes integer (32-bit signed) to double automatically when overflowing, but the second one should be quite a lot faster. Taking n as a bignum should work automatically, using the call gmp::as.bigz(n), should loss of precision under doubles be worrisome, and then the language would be R + gmp.


Build a working chessboard The challenge

Create a program that mimics a chessboard.

The datails

The chessboard must be surrounded by the labels of each row and column, being the columns labeled from 'a' to 'h' and the rows labeled from '1' to '8'. Also, place the default position for each chess piece (blacks are on the top). Each piece is represented by the first letter of his name:

King = K
Queen = Q
Rook = R
Bishop = B
Knight = N
Pawn = P

Also by his colour

W = White
B = Black

So any given piece is recognized by his name and colour. E.G: NB = Black Knight. Empty squares are represented by a hyphen (-).

The program must show the chess board with the pieces. Then it should ask the user to make a move with the message "Move". The program must read user input by console or equivalent. We don't care if the move is legal or not. The program must reprint the chess board with the piece moved, deleting any piece it was on that square. The move is represented origin square destination square. E.g:

2c 5d = Moves the piece in square 2c to square 5d

If the program detects there is not piece in the origin square or an invalid input, it must show the message "Invalid move" and ask again for another move. If the program detects the final square is occuped by another piece it must show the message "[Name of the moving piece] x [Name of the captured piece]". Eg:

PB x KW

The program is intended to run in a loop, so after each user input the program will ask again for another move. There is no exit clause for the loop.

Example of a initial chessboard and first user's input and program's output:

-   a   b   c   d   e   f   g   h   -

8   RB  NB  BB  QB  KB  BB  NB  RB  8

7   PB  PB  PB  PB  PB  PB  PB  PB  7

6   -   -   -   -   -   -   -   -   6

5   -   -   -   -   -   -   -   -   5

4   -   -   -   -   -   -   -   -   4

3   -   -   -   -   -   -   -   -   3

2   PW  PW  PW  PW  PW  PW  PW  PW  2

1   RW  NW  BW  QW  KW  BW  NW  RW  1

-   a   b   c   d   e   f   g   h   -

Move
2a 4a

-   a   b   c   d   e   f   g   h   -

8   RB  NB  BB  QB  KB  BB  NB  RB  8

7   PB  PB  PB  PB  PB  PB  PB  PB  7

6   -   -   -   -   -   -   -   -   6

5   -   -   -   -   -   -   -   -   5

4   PW  -   -   -   -   -   -   -   4

3   -   -   -   -   -   -   -   -   3

2   -   PW  PW  PW  PW  PW  PW  PW  2

1   RW  NW  BW  QW  KW  BW  NW  RW  1

-   a   b   c   d   e   f   g   h   -

Move

Perl, 211 characters
y/W/B/for@8=@1=map$_.W,split//,RNBQKBNR;@b{$_.1..$_.9}=(@$_,/2/?PW:/7/?PB:"- ")x8for@r=reverse 1..8;$c=join"  ","",a..h;do{y/a-h\n/1-8/d;/ /;@b{$',$`}=@b{$`,19};say$c;say"$_ @b{$_.1..$_.8} $_"for@r;say$c}while<>

Nothing very unusual about this first attempt, except maybe the use of a do..while loop in golf.  Uses say, so you need to run this with perl -M5.01.  The input parsing is really klugy and fragile; in particular, excess whitespace will kill it.  On the other hand, you're not constrained to use 1-8 for rows and a-h for columns, either will do.  End the program with Ctrl-C or by ending the input (Ctrl-D in Unix).
I assumed I don't need to match the whitespace in the sample output exactly — I prefer a more compact board anyway.  (I did keep the board orientation, even though flipping it upside down would save me eight chars.)  A sample game session might look something like this:
  a  b  c  d  e  f  g  h
8 RB NB BB QB KB BB NB RB 8
7 PB PB PB PB PB PB PB PB 7
6 -  -  -  -  -  -  -  -  6
5 -  -  -  -  -  -  -  -  5
4 -  -  -  -  -  -  -  -  4
3 -  -  -  -  -  -  -  -  3
2 PW PW PW PW PW PW PW PW 2
1 RW NW BW QW KW BW NW RW 1
  a  b  c  d  e  f  g  h
2f 3f
  a  b  c  d  e  f  g  h
8 RB NB BB QB KB BB NB RB 8
7 PB PB PB PB PB PB PB PB 7
6 -  -  -  -  -  -  -  -  6
5 -  -  -  -  -  -  -  -  5
4 -  -  -  -  -  -  -  -  4
3 -  -  -  -  -  PW -  -  3
2 PW PW PW PW PW -  PW PW 2
1 RW NW BW QW KW BW NW RW 1
  a  b  c  d  e  f  g  h
7e 5e
  a  b  c  d  e  f  g  h
8 RB NB BB QB KB BB NB RB 8
7 PB PB PB PB -  PB PB PB 7
6 -  -  -  -  -  -  -  -  6
5 -  -  -  -  PB -  -  -  5
4 -  -  -  -  -  -  -  -  4
3 -  -  -  -  -  PW -  -  3
2 PW PW PW PW PW -  PW PW 2
1 RW NW BW QW KW BW NW RW 1
  a  b  c  d  e  f  g  h
2g 4g
  a  b  c  d  e  f  g  h
8 RB NB BB QB KB BB NB RB 8
7 PB PB PB PB -  PB PB PB 7
6 -  -  -  -  -  -  -  -  6
5 -  -  -  -  PB -  -  -  5
4 -  -  -  -  -  -  PW -  4
3 -  -  -  -  -  PW -  -  3
2 PW PW PW PW PW -  -  PW 2
1 RW NW BW QW KW BW NW RW 1
  a  b  c  d  e  f  g  h
8d 4h
  a  b  c  d  e  f  g  h
8 RB NB BB -  KB BB NB RB 8
7 PB PB PB PB -  PB PB PB 7
6 -  -  -  -  -  -  -  -  6
5 -  -  -  -  PB -  -  -  5
4 -  -  -  -  -  -  PW QB 4
3 -  -  -  -  -  PW -  -  3
2 PW PW PW PW PW -  -  PW 2
1 RW NW BW QW KW BW NW RW 1
  a  b  c  d  e  f  g  h
^C


Am I a 'Redivosite' Number? Redivosite is a portmanteau word invented for the sole purpose of this challenge. It's a mix of Reduction, Division and Composite.

Definition

Given an integer N > 6:

If N is prime, N is not a Redivosite Number.
If N is composite:

repeatedly compute N' = N / d + d + 1 until N' is prime, where d is the smallest divisor of N greater than 1
N is a Redivosite Number if and only if the final value of N' is a divisor of N

Below are the 100 first Redivosite Numbers (no OEIS entry at the time of posting):

14,42,44,49,66,70,143,153,168,169,176,195,204,260,287,294,322,350,414,462,518,553,572,575,592,629,651,702,726,735,775,806,850,869,889,891,913,950,1014,1023,1027,1071,1118,1173,1177,1197,1221,1235,1254,1260,1302,1364,1403,1430,1441,1554,1598,1610,1615,1628,1650,1673,1683,1687,1690,1703,1710,1736,1771,1840,1957,1974,2046,2067,2139,2196,2231,2254,2257,2288,2310,2318,2353,2392,2409,2432,2480,2522,2544,2635,2640,2650,2652,2684,2717,2758,2760,2784,2822,2835

Examples

N = 13: 13 is prime, so 13 is not a Redivosite Number
N = 32: 32 / 2 + 3 = 19; 19 is not a divisor or 32, so 32 is not a Redivosite Number
N = 260: 260 / 2 + 3 = 133, 133 / 7 + 8 = 27, 27 / 3 + 4 = 13; 13 is a divisor or 260, so 260 is a Redivosite Number

Your task

Given an integer N, return a truthy value if it's a Redivosite Number or a falsy value otherwise. (You may also output any two distinct values, as long as they're consistent.)
The input is guaranteed to be larger than 6.
This is code-golf, so the shortest answer in bytes wins!

Haskell, 91 85 83 80 75 74 bytes

n#m=([n#(div m d+d+1)|d<-[2..m-1],mod m d<1]++[mod n m<1&&m<n])!!0
f x=x#x

Try it online!

f x=x#x                           -- call # with x for both parameters
n#m
         |d<-[2..m-1],mod m d<1   -- for all divisors d of m
    [n#(div m d+d+1)           ]  -- make a list of recursive calls to #,
                                  -- but with m set to m/d+d+1
   ++ [mod n m<1&&m<n]            -- append the Redivosite-ness of n (m divides n,
                                  -- but is not equal to n)
                           !!0    -- pick the last element of the list
                                  -- -> if there's no d, i.e. m is prime, the
                                  --    Redivosite value is picked, else the
                                  --    result of the call to # with the smallest d

Edit: -2 bytes thanks to @BMO, -3 bytes thanks to @H.PWiz and -5 -6  bytes thanks to @Ørjan Johansen


Generalized Cantor set segment lengths Problem

Let's define a generalized Cantor set by iteratively deleting some rational length segments from the middle of all intervals that haven't yet been deleted, starting from a single continuous interval.

Given the relative lengths of segments to delete or not, and the number of iterations to do, the problem is to write a program or function that outputs the relative lengths of the segments that have or have not been deleted after n iterations.

Example: Iteratively delete the 4th and 6th eighth

Input:

n – number of iterations, indexed starting from 0 or 1

l – list of segment lengths as positive integers with gcd(l)=1 and odd length, representing the relative lengths of the parts that either stay as they are or get deleted, starting from a segment that doesn't get deleted. Since the list length is odd, the first and last segments never get deleted.
For example for the regular Cantor set this would be [1,1,1] for one third that stays, one third that gets deleted and again one third that doesn't.

Output:

Integer list o, gcd(o)=1, of relative segment lengths in the nth iteration when the segments that weren't deleted in the previous iteration are replaced by a scaled down copy of the list l. The first iteration is just [1]. You can use any unambiguous output method, even unary.

Examples

n=0, l=[3,1,1,1,2] →                 [1]
n=1, l=[3,1,1,1,2] →     [3,    1,    1,    1,    2]
n=2, l=[3,1,1,1,2] → [9,3,3,3,6,8,3,1,1,1,2,8,6,2,2,2,4]

n=3, l=[5,2,3]     → [125,50,75,100,75,30,45,200,75,30,45,60,45,18,27]
n=3, l=[1,1,1]     → [1,1,1,3,1,1,1,9,1,1,1,3,1,1,1]

You can assume the input is valid. This is code-golf, so the shortest program measured in bytes wins.

Jelly,  15 13  12 bytes

-2 thanks to Dennis (using a Link rather than a chain allows right to be used implicitly by ¡; No need to wrap the 1 in a list due to the fact that Jelly prints lists of one item the same as the item)
-1 thanks to Erik the Outgolfer (use Ɗ to save the newline from using Ç)

1×€³§JḤ$¦ẎƊ¡

A full program printing a list in Jelly format (so [1] is printed as 1)

Try it online!

How?

1×€³§JḤ$¦ẎƊ¡ - Main link: segmentLengths; iterations
1            - literal 1 (start with a single segment of length 1)
           ¡ - repeat...
             - ...times: implicitly use chain's right argument, iterations
          Ɗ  - ...do: last 3 links as a monad (with 1 then the previous output):
   ³         - (1) program's 3rd argument = segmentLengths
 ×€          -  1  multiply €ach (e.g. [1,2,3] ×€ [1,2,1] = [[1,4,3],[2,4,2],[3,6,3]])
        ¦    -  2  sparse application...
       $     - (2) ...to: indices: last two links as a monad:
     J       - (2)          range of length = [1,2,3,...,numberOfLists]
      Ḥ      - (2)          double            [2,4,6,...] (note: out-of bounds are ignored by ¦)
    §        - (2) ...of: sum each (i.e. total the now split empty spaces)
         Ẏ   -  3  tighten (e.g. [[1,2,3],4,[5,6,7]] -> [1,2,3,4,5,6,7])
             - implicit print


Zebra stripe command output I have a script:

$ cat ~/zebra.pl
#!/bin/perl
use Term::ANSIColor;

$Term::ANSIColor::EACHLINE = "\n";

my $zebra = 1; # Are zebras black with white stripes, or white with black stripes?!

my $black = color('white on_black');
my $blue = color('white on_blue');

while (<>){
    chomp($_);

    $zebra = $zebra == 1 ? 0 : 1;

    ($zebra == 1 && print $blue) || print $black;

    print $_;

    ($zebra == 1 && print $black) || print $blue;

    print "\n";
}

print color('reset');

Usage:

some-command | zebra

The output consists of alternating lines that have black and blue backgrounds, respectively. The script seems needlessly long and complex. I'm wondering how much shorter it could be.


Number Plate Golf: Parsing See Also: Recognition

Introduction

You've now been taken off the speed camera development team (let's face it, your code is nowhere near production code standards) and are now working on a program to extract information about the car from the number plates. Of course, you've caught the code golf bug and want to write the program in as few bytes as possible.

Challenge

Given a valid, British number plate, display information about the car's registration.

You only have to support number plates registered between 2001 and 2051 (inclusive).

Internet access is disallowed.

The input will be given as a string.

Number Plates

British number plates are ordered like so:

Area code

A table with all of the area code mnemonics which you need to support can be found here.

For the letter X, you only need to output Personal Export due to multiple areas being covered by the same mnemonic.

You must output the DVLA office name.

Age Identifier

Similarly, a table with all of the age identifiers which you need to support can be found here.

If the identifier is in the range Y to 50 inclusive, you must output:

1/3/[Year] to 31/8/[Year]

Likewise, if the identifier is in the range 51 to 00 inclusive, you must output:

1/9/[Year] to [28/29]/2/[Year + 1]

You should support leap years.

Examples

WK94 FRS

Truro, 1/9/2044 to 28/2/2045

CB16 BTD

Bangor, 1/3/2016 to 31/8/2016

BD51 SMR

Birmingham, 1/9/2011 to 29/2/2012

XAY EEA

Personal Export, 1/3/2001 to 31/8/2001

Scoring

The shortest code in bytes wins

Ruby, 629 bytes
s=gets
p=c=0
'PETeRborOuGh
NORWich
IPSwicH
BIRMiNGHam
CARdiff
SWANsea
BAngOr
CHEsTer
SHREWsbURY
CHELmSFOrd
NOTTInGHAm
LInCOlN
MAIDStone
BRIgHtON
BOURNEMoUth
PORTSMoUth
ISLE OF WIGHt
PORtSmOUtH
BOREHAMwoOD
NORTHAmPton
WIMBLeDoN
BOREHAMwOoD
SIdcup
MANChESTer
NEWCAstle
STOcKtON
oXFOrd
PReStON
CArlISlE
ReADIng
GLAsGoW
EDINBUrGh
DUNdEe
ABERDEen
INvErNEsS
WORcESTer
EXeTeR
TRUro
BRiStoL
PERSONAL eXPOrt
LeEds
SHEFFiElD
BEVERLEY'.split($/).map{|w|c<s[0,2].to_i(35)&&p=w;d=0;w.bytes{|b|d+=d+b/95};c+=d}
y=(?1+s[2,9]).to_i-1
puts p.capitalize+", 1/%d/20%02d to %d/%d/20%02d"%[z=3+y%100/50*6,1+y%=50,z<4?31:y%4==2?29:28,(z+5)%12,1+y+z/9]

The first two letters are interpreted as a base 35 number and then looked up to find the correct town. The quantity of addresses assigned to each town is encoded (run-length encoding) in the captialization of each town in binary, where uppercase=0 and lowercase=1.
In order to handle the Y age indicator for the first half of 2001, a 1 is prepended to the age. Thus 1 Y is interpreted by .to_i as 1, and 1 02 is interpreted as 102. 1 is subtracted (to handle the wraparound for 2050) and taken modulo 100 to decide which half of the year we are in. It is then taken modulo 50 (and the 1 added on again) to find the year.


Look-and-say: Conway revisited You should all be familiar with the Conway sequence (a.k.a. 'look-and-say'-sequence) by now:

     1
    11
    21
  1211
111221
312211
etc

You can also start by any arbitrary number as starting point. Let f(s) be the next element of the sequence. Now for every given swe can find f(s). The reverse is not as trivial: it is not for every y possible to find the predecessor s such that f(s) = y. E.g. for y = 1 we cannot find a predecessor. But if y has an even length you can divide it into pairs of digits which describe each one part of a predecessor:

513211 divides in 51,32,11
so: 51 comes from 11111
    32 comes from 222
    11 comes from 1
put together: 111112221

So this way there we can define an unique predecessor for every y of even length.

Note: The 'predecessor' s defined this way does generally NOT satisfy f(s) = y.

Goal

Write a function / program snippet that accepts a string of digits as input that

calculates the next element of the Conway sequence if the length of the input string is odd
calculates the predecessor of the input string as defined above if the input string length is even.

Shortest code in bytes wins.

Recent Questions based on the look-and-say sequences:

Look and say sequence
Point-free look and say sequence
Quickly find length of n-th term of the look-and-say sequence

Ruby, 125 120 119 101 bytes

f=->n{c=n.chars;(n.size%2>0?c.chunk{|x|x}.map{|a,b|[b.size,a]}:c.each_slice(2).map{|a,b|b*a.hex})*''}

String input taken through function f:

f['111221']    # => "1211"
f['513211']    # => "111112221"
f['111112221'] # => "513211"

Expanded with notes:

# define lambda that takes one arg
f = -> (n) {
  # store digits in c
  c = n.chars

  # n is of odd length
  if n.size % 2 > 0
    # group identical numbers
    c.chunk{ |x| x }.map do |a, b|
      # array of [digit count, digit value]
      [b.size, a]
    end
  else
    # slice array into groups of two elements
    c.each_slice(2).map do |a, b|
      # repeat the second digit in a pair
      # the first digit-times.
      b * a.hex
    end
  end * '' # join array
}


Tile the chessboard with four-colored triominoes Task:
Consider the problem: "given a chessboard with one square missing, cut it into 21 L-triominoes". There is a well-known constructive proof that this can be done for any square chessboard size that is a power of two. It works by splitting the chessboard into a smaller chessboard with the hole in it and one big triomino and then observing that that triomino can be cut into four triominoes recursively.
In this task, you are required to cut an 8x8 chessboard into L-shaped triominoes and then to color them with four colors such that no two adjacent triominoes have the same color.
Specification:
Your input is the position of the hole, given as a pair of integers. You may choose which one is the column index and which one is the row index. You may choose if each starts at 0 or at 1 and away from which corner they increase. You may require A..H as the first coordinate instead of 0..7 or 1..8. You may also accept both coordinates packed into a single integer 0..63 or 1..64 in lexicographical order (row-major or column-major, left to right or right to left, up to down or down to up). You may write a full program, or a function.
You may output the tiling as ASCII, as colored ASCII or as graphical primitives. If you choose ASCII output, you may choose any four printable ASCII characters to represent the four colors. If you choose colored ASCII, you may choose any four printable ASCII characters or just one character other than space. The hole must be represented by the space character. If one of your characters is the space character, no triomino adjacent to the hole or at the chessboard edge may be of this color.
If you choose colored ASCII or graphical output, you may choose any four colors out of #000, #00F, #0F0, #0FF, #F00, #F0F, #FF0, #FFF or their closest equivalents available in your environment. If you choose graphical output, your graphical primitives must be filled squares at least 32x32 pixels in size and separated by no more than two pixels of other color. If the above exceeds the screen resolution of your environment, the minimum size requirement is relaxed to the largest square size that still fits on the screen.
You may choose any valid tiling of the given chessboard. You may choose any four-coloring of the tiling you choose. Your choice of four colors must be the same across all outputs, but you aren't required to use every color in every output.
Examples:
Possible output for input = [0, 0] (top left corner)
 #??##??
##.?#..?
?..#??.#
??##.?##
##?..#??
#.??##.?
?..#?..#
??##??##

Another possible output of the same program (input = [0, 7]):
??#??#?
?##?##??
..xx..xx
.?x#.?x#
??##??##
..xx..xx
.?x#.?x#
??##??##

A different program may also produce, for the input of "D1" (note the nonstandard but allowed chessboard orientation),
AABBCCAA
ACBACBAC
CCAABBCC
 ABBAADD
AABDABDC
BBDDBBCC
BABBACAA
AABAACCA

JavaScript (ES6),  184 ... 171  163 bytes

Takes input as (x)(y), with \$0\leq x\leq7\$ and \$0\leq y\leq7\$. Outputs as a string with 3 colors (marked as \$0\$, \$1\$ and \$2\$).

h=>v=>(a=[...'3232132031021010'],a[5+(v&4|h>3)]^=3,a[v/2<<2|h/2]=v%2*2+h%2,g=x=>y&8?'':(x<8?x-h|y-v?a[y/2<<2|x/2]^y%2*2+x%2?(x^y)&2:1:' ':`
`)+g(-~x%9||!++y))(y=0)

Try it online!

Method

We work on a matrix of \$4\times4\$ triominoes:

$$\begin{pmatrix}
t_0&t_1&t_2&t_3\\
t_4&t_5&t_6&t_7\\
t_8&t_9&t_{10}&t_{11}\\
t_{12}&t_{13}&t_{14}&t_{15}
\end{pmatrix}$$

Each triomino is one of:

The initial configuration of the matrix is as follows:

$$\begin{pmatrix}
3&2&3&2\\
1&3&2&0\\
3&1&0&2\\
1&0&1&0
\end{pmatrix}$$

We alternate the first 2 colors just like we would on any chessboard, which gives:

The next steps are:

According to the quadrant in which the hole is located, we rotate one of the 4 center triominoes (\$t_5\$, \$t_6\$, \$t_9\$ or \$t_{10}\$) by 180°.
We rotate the triomino on which the hole is located (it may be the same triomino as in step #1), so that it does not cover the hole.
We fill the holes with the 3rd color (except the 'real' hole).

For instance, assuming that the hole is located at \$(3,0)\$, this gives:

And it that case, the final matrix is:

$$\begin{pmatrix}
3&\color{red}1&3&2\\
1&\color{red}0&2&0\\
3&1&0&2\\
1&0&1&0
\end{pmatrix}$$

Commented

h => v => (                       // (h, v) = hole coordinates
  a = [...'3232132031021010'],    // a[] = flat representation of the 4x4 matrix
  a[5 + (v & 4 | h > 3)] ^= 3,    // first rotation, achieved by XOR'ing with 3
  a[v / 2 << 2 | h / 2] =         // second rotation according to the
    v % 2 * 2 + h % 2,            // position of the hole within the triomino's square
  g = x =>                        // g is a recursive function that converts the 4x4
                                  // matrix into a 8x8 ASCII art
    y & 8 ?                       // if y = 8:
      ''                          //   stop recursion and return an empty string
    :                             // else:
      ( x < 8 ?                   //   if this is not the end of the row:
          x - h | y - v ?         //     if this is not the position of the hole:
            a[y / 2 << 2 | x / 2] //       if this part of the triomino located at this
            ^ y % 2 * 2 + x % 2 ? //       position is 'solid':
              (x ^ y) & 2         //         use either color #0 or color #2
            :                     //       else:
              1                   //         use color #1
          :                       //     else:
            ' '                   //       the hole is represented with a space
        :                         //   else:
          `\n`                    //     append a linefeed
      ) + g(-~x % 9 || !++y)      //   append the result of a recursive call
)(y = 0)                          // initial call to g with x = y = 0

Graphical output

Click on the picture to set the position of the hole.

f=
h=>v=>(a=[...'3232132031021010'],a[5+(v&4|h>3)]^=3,a[v/2<<2|h/2]=v%2*2+h%2,g=x=>y&8?'':(x<8?x-h|y-v?a[y/2<<2|x/2]^y%2*2+x%2?(x^y)&2:1:' ':`
`)+g(-~x%9||!++y))(y=0)

;(u = (x, y) => { for(out = '', a = f(x)(y).split('\n'), y = 0; y < 8; y++) for(x = 0; x < 8; x++) out += `<div class="b b${a[y][x] == ' ' ? 'H' : a[y][x]}"></div>`; o.innerHTML = out; })(0, 0); o.onclick = e => u(e.clientX >> 4, e.clientY >> 4)
body { margin: 0; padding: 0; }
#o { width: 128px; height: 128px; }
.b { float: left; width: 14px; height: 14px; border: solid 1px; }
.b0 { background-color: #44f; border-color: #66f #22d #22d #66f; }
.b1 { background-color: #652e65; border-color: #874f87 #430c43 #430c43 #874f87; }
.b2 { background-color: #ffc90e; border-color: #ffeb2f #dda70c #dda70c #ffeb2f; }
.bH { border-color: #000; }


How does the square end? In base-10, all perfect squares end in \$0\$, \$1\$, \$4\$, \$5\$, \$6\$, or \$9\$.
In base-16, all perfect squares end in \$0\$, \$1\$, \$4\$, or \$9\$.
Nilknarf describes why this is and how to work this out very well in this answer, but I'll also give a brief description here:
When squaring a base-10 number, \$N\$, the "ones" digit is not affected by what's in the "tens" digit, or the "hundreds" digit, and so on. Only the "ones" digit in \$N\$ affects the "ones" digit in \$N^2\$, so an easy (but maybe not golfiest) way to find all possible last digits for \$N^2\$ is to find \$n^2 \mod 10\$ for all \$0 \le n < 10\$. Each result is a possible last digit. For base-\$m\$, you could find \$n^2 \mod m\$ for all \$0 \le n < m\$.
Write a program which, when given the input \$N\$, outputs all possible last digits for a perfect square in base-\$N\$ (without duplicates). You may assume \$N\$ is greater than \$0\$, and that \$N\$ is small enough that \$N^2\$ won't overflow (If you can test all the way up to \$N^2\$, I'll give you a finite amount of brownie points, but know that the exchange rate of brownie points to real points is infinity to one).
Tests:
 Input -> Output
 1     -> 0
 2     -> 0,1
 10    -> 0,1,5,6,4,9
 16    -> 0,1,4,9
 31    -> 0,1,2,4,5,7,8,9,10,14,16,18,19,20,25,28
 120   -> 0,1,4,9,16,24,25,36,40,49,60,64,76,81,84,96,100,105

this is code-golf, so standard rules apply!
(If you find this too easy, or you want a more in-depth question on the topic, consider this question: Minimal cover of bases for quadratic residue testing of squareness).

Google Sheets, 52 51 47 bytes
=ArrayFormula(Join(",",Unique(Mod(Row(A:A)^2,A1

Saved 4 bytes thanks to Taylor Scott
Sheets will automatically add 4 closing parentheses to the end of the formula.
It doesn't return the results in ascending order but it does return the correct results.


Taxi me some numbers Taxicab Numbers or OEIS A011541 are the least numbers that are able to be represented as \$n\$ different sums of two positive cubed integers, for successive \$n\$.
You'll need to print out the \$n\$th taxicab number. This should work for any \$n\$ in theory.
However, as only 6 taxicab numbers have been discovered so far, there won't be an \$n\$ above 6. The numbers are \$2, 1729, 87539319, 6963472309248, 48988659276962496\$ and \$24153319581254312065344\$.
You're not allowed to hard code these variables, because your program must work for any arbitrary \$n\$ in theory.

Taxi, 4758 bytes
What better language to calculate taxicab numbers than one that simulates taxicabs?
This is a joke. There are so many better languages. What happened to the last two days of my life?
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 l 1 l 2 r.Pickup a passenger going to Bird's Bench.Pickup a passenger going to Cyclone.Go to Zoom Zoom:n.Go to Cyclone:w.Pickup a passenger going to Rob's Rest.Pickup a passenger going to Cyclone.Go to Bird's Bench:n 1 r 2 r 1 l.Go to Rob's Rest:n.Go to Cyclone:s 1 l 1 l 2 l.[a]Pickup a passenger going to Firemouth Grill.Pickup a passenger going to The Underground.Go to Zoom Zoom:n.Go to Firemouth Grill:w 3 l 2 l 1 r.Go to The Underground:e 1 l.Switch to plan "b" if no one is waiting.Pickup a passenger going to Cyclone.Go to Cyclone:n 3 l 2 l.Switch to plan "a".[b]Go to Firemouth Grill:s 1 r.[c]Pickup a passenger going to Cyclone.Go to Cyclone:w 1 l 1 r 2 r.Pickup a passenger going to Cyclone.Go to Zoom Zoom:n.Go to Cyclone:w.Pickup a passenger going to Multiplication Station.Pickup a passenger going to Multiplication Station.Pickup a passenger going to Multiplication Station.Go to Multiplication Station:s 1 l 2 r 4 l.Pickup a passenger going to Trunkers.Go to Trunkers:s 1 r 2 l.Go to Firemouth Grill:e 1 l 1 r.Switch to plan "e" if no one is waiting.Switch to plan "c".[e]Go to Trunkers:w 1 l 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:w 2 r.Pickup a passenger going to Sunny Skies Park.Go to Sunny Skies Park:n 1 r.[f]Go to Trunkers:s 1 l.Switch to plan "g" if no one is waiting.Pickup a passenger going to Sunny Skies Park.Go to Cyclone:w 2 r.Pickup a passenger going to Cyclone.Go to Zoom Zoom:n.Go to Cyclone:w.Go to Sunny Skies Park:n 1 r.Switch to plan "f".[g]Go to Cyclone:w 2 r.Switch to plan "h" if no one is waiting.Pickup a passenger going to Firemouth Grill.Go to Zoom Zoom:n.Go to Firemouth Grill:w 3 l 2 l 1 r.Go to Trunkers:w 1 l 1 r.Switch to plan "g".[h]Go to Sunny Skies Park:n 1 r.Switch to plan "i" if no one is waiting.Pickup a passenger going to Cyclone.Go to Firemouth Grill:s 1 l 1 l 1 r.Pickup a passenger going to Addition Alley.Go to Cyclone:w 1 l 1 r 2 r.Pickup a passenger going to Addition Alley.Pickup a passenger going to Trunkers.Go to Zoom Zoom:n.Go to Trunkers:w 3 l.Go to Addition Alley:w 2 r 2 r 1 r.Pickup a passenger going to Narrow Path Park.Go to Narrow Path Park:n 1 r 1 l 1 r.Go to Cyclone:w 1 l 1 r 2 l.Switch to plan "h".[i]Go to Trunkers:s 1 l.Pickup a passenger going to Knots Landing.Go to Knots Landing:e 1 r 2 l 5 r.Go to Trunkers:w 1 l 3 r 1 l.Switch to plan "j" if no one is waiting.Go to Firemouth Grill:e 1 l 1 r.Switch to plan "e".[j]0 is waiting at Starchild Numerology.Go to Starchild Numerology:w 1 l 2 l.Pickup a passenger going to Addition Alley.[k]Go to Rob's Rest:w 1 r 2 l 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:s 1 l 1 l 2 l.Pickup a passenger going to Rob's Rest.Pickup a passenger going to Equal's Corner.Go to Zoom Zoom:n.Go to Rob's Rest:w 2 l 2 r 1 r.Go to Narrow Path Park:s 1 l 1 l 1 r 1 r 2 l 5 l.Switch to plan "o" if no one is waiting.Pickup a passenger going to Equal's Corner.Go to Equal's Corner:w 1 l 1 r 2 l 1 l.Switch to plan "l" if no one is waiting.Pickup a passenger going to Knots Landing.1 is waiting at Starchild Numerology.Switch to plan "m".[l]0 is waiting at Starchild Numerology.[m]Go to Starchild Numerology:n 1 r.Pickup a passenger going to Addition Alley.Go to Addition Alley:w 1 r 3 r 1 r 1 r.Pickup a passenger going to Addition Alley.Go to Knots Landing:n 1 r 2 r 1 l.Go to Starchild Numerology:w 1 l 3 r 1 l 1 l 2 l.Switch to plan "k".[o]0 is waiting at Starchild Numerology.Go to Starchild Numerology:w 1 l 1 r 2 l 1 l 3 l.Pickup a passenger going to Equal's Corner.Go to Equal's Corner:w 1 l.Go to Addition Alley:n 4 r 1 r 1 r.Pickup a passenger going to Equal's Corner.Go to Bird's Bench:n 1 l 1 l 1 l 2 r 1 l.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 r 1 l 2 l.Pickup a passenger going to Bird's Bench.Pickup a passenger going to Equal's Corner.Go to Bird's Bench:n 1 r 2 r 1 l.Go to Equal's Corner:n 1 r 1 r.Switch to plan "p" if no one is waiting.Go to Starchild Numerology:n 1 r.Go to Rob's Rest:w 1 r 2 l 1 r.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 l 1 r 1 r 1 r.Pickup a passenger going to Post Office.Go to Post Office:n 1 l 1 r.Switch to plan "z".[p]1 is waiting at Starchild Numerology.Go to Starchild Numerology:n 1 r.Pickup a passenger going to Addition Alley.Go to Rob's Rest:w 1 r 2 l 1 r.Pickup a passenger going to Addition Alley.Go to Addition Alley:s 1 l 1 l 2 r 1 r 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 l 1 l.Pickup a passenger going to Rob's Rest.Pickup a passenger going to Cyclone.Go to Rob's Rest:n 1 r 2 r 1 r.Go to Cyclone:s 1 l 1 l 2 l.Switch to plan "a".[z]

Try it online!
Try it online but with comments and line breaks!
Note: TIO can handle an input of 1 but 2 and above cause a timeout issue. I wrote a little snippet to print the value being checked every iteration and it only got up to 137 before it timed out. If someone who knows what they're doing could run it through an interpreter (the homepage links to a C++ version) to verify higher values, I'd appreciate it. It may take a very long time to run.
Ungolfed with comments:
[ FIND THE NTH TAXI CAB NUMBER ]
[ https://en.wikipedia.org/wiki/Taxicab_number ]
[ Inspired by https://codegolf.stackexchange.com/q/73827/38183 ]

[ A taxi cab number T(n) is the smallest number that can be made from the sum  ]
[ of two positive cubes in n different ways. For example, T(1) = 2 because     ]
[ 2 = 1^3 + 1^3. That is the only way to make 2 by summing positive cubes. No  ]
[ solution exists for 1 so 2 is T(1). T(2) = 1729 = 1^3 + 12^3 = 9^3 + 10^3.   ]
[ This program takes n as input and finds T(n). The (bad) psuedocode is:       ]
[                                                                              ]
[    S = STDIN;  // Use Bird's Bench                                           ]
[    T = STDIN;  // Use Rob's Rest. Saves bytes and T(n) > n is always true.   ]
[    while (true) {                                                            ]
[       // Fill an array (Firemouth Grill) with the numbers 1 through T        ]
[       // This will make it much easier to compute the cubes because a taxi   ]
[       // can only carry three passengers at a time.                          ]
[       for (i = T; i > 0; i--) { A.push(i) }                                  ]
[       // Fill an array (Trunkers) with the cubes of all integers 1 through T ]
[       for (i = T; i > 0; i--) { B.push(i ^ 3) }                              ]
[       // Fill an array (Sunny Skies Park) with each possible sum of cubes    ]
[       while (B(0) != null) {                                                 ]
[          // Make copies of the next value to add to each remaining value     ]
[          C.push(B(0));                                                       ]
[          while (B(0) != null) {                                              ]
[             C.push(C(0));                                                    ]
[             D.push(B(0));                                                    ]
[             B.shift();                                                       ]
[          }                                                                   ]
[          // Store each possible sum with this cube                           ]
[          while (C(0) != null) {                                              ]
[             E.push(C(0) + D(0));                                             ]
[             B.push(D(0));                                                    ]
[             C.shift;                                                         ]
[             D.shift;                                                         ]
[          }                                                                   ]
[       }                                                                      ]
[       // Check each possible sum to see if it equals T                       ]
[       N = 0;                                                                 ]
[       while (D(0) != null) {                                                 ]
[          if (D(0) = T) { N++ }                                               ]
[          D.shift();                                                          ]
[       }                                                                      ]
[       // If we found the desired number of sums, ouput and break             ]
[       // Otherwise, go to the next T and keep going                          ]
[       if (N = S) {                                                           ]
[          print(T);                                                           ]
[          break;                                                              ]
[       } else {                                                               ]
[          T++;                                                                ]
[       }                                                                      ]
[    }                                                                         ]
[                                                                              ]

[ S = STDIN;  // Use Bird's Bench                                         ]
[ T = STDIN;  // Use Rob's Rest. Saves bytes and T(n) > n is always true. ]
Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st left 1st left 2nd right.
Pickup a passenger going to Bird's Bench.
Pickup a passenger going to Cyclone.
Go to Zoom Zoom: north.
Go to Cyclone: west.
Pickup a passenger going to Rob's Rest.
Pickup a passenger going to Cyclone.
Go to Bird's Bench: north 1st right 2nd right 1st left.
Go to Rob's Rest: north.

[ // Fill an array (Firemouth Grill) with the numbers 1 through T      ]
[ // This will make it much easier to compute the cubes because a taxi ]
[ //  can only carry three passengers at a time.                       ]
[ for (i = T; i > 0; i--) { A.push(i) }                                ]
Go to Cyclone: south 1st left 1st left 2nd left.
[a]
Pickup a passenger going to Firemouth Grill.
Pickup a passenger going to The Underground.
Go to Zoom Zoom: north.
Go to Firemouth Grill: west 3rd left 2nd left 1st right.
Go to The Underground: east 1st left.
Switch to plan "b" if no one is waiting.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 3rd left 2nd left.
Switch to plan "a".

[b]
[ // Fill an array (Trunkers) with the cubes of all integers 1 through T ]
[ for (i = T; i > 0; i--) { B.push(i ^ 3); }                             ]
Go to Firemouth Grill: south 1st right.
[c]
Pickup a passenger going to Cyclone.
Go to Cyclone: west 1st left 1st right 2nd right.
Pickup a passenger going to Cyclone.
Go to Zoom Zoom: north.
Go to Cyclone: west.
Pickup a passenger going to Multiplication Station.
Pickup a passenger going to Multiplication Station.
Pickup a passenger going to Multiplication Station.
Go to Multiplication Station: south 1st left 2nd right 4th left.
Pickup a passenger going to Trunkers.
Go to Trunkers: south 1st right 2nd left.
Go to Firemouth Grill: east 1st left 1st right.
Switch to plan "e" if no one is waiting.
Switch to plan "c".

[e]
[ // Fill an array with each possible sum of cubes                ]
[ while (B(0) != null) {                                          ]
[ // Make copies of the next value to add to each remaining value ]
[ C.push(B(0));                                                   ]
[ while (B(0) != null) {                                          ]
[    C.push(C(0));                                                ]
[    D.push(B(0));                                                ]
[    B.shift();                                                   ]
[ }                                                               ]
[ Setup Cyclone with a copy of the first value ]
Go to Trunkers: west 1st left 1st right.
Pickup a passenger going to Cyclone.
Go to Cyclone: west 2nd right.
Pickup a passenger going to Sunny Skies Park.
Go to Sunny Skies Park: north 1st right.

[f]
[ Move any remaining values to Sunny Skies Park, duplicating Cyclone each time ]
Go to Trunkers: south 1st left.
Switch to plan "g" if no one is waiting.
Pickup a passenger going to Sunny Skies Park.
Go to Cyclone: west 2nd right.
Pickup a passenger going to Cyclone.
Go to Zoom Zoom: north.
Go to Cyclone: west.
Go to Sunny Skies Park: north 1st right.
Switch to plan "f".

[g]
[ // Store each possible sum with this cube ]
[ while (C(0) != null) {                    ]
[    E.push(C(0) + D(0));                   ]
[    B.push(D(0));                          ]
[    C.shift;                               ]
[    D.shift;                               ]
[ }                                         ]
[ Move everything at Cyclone to Firemouth Grill ]
Go to Cyclone: west 2nd right.
Switch to plan "h" if no one is waiting.
Pickup a passenger going to Firemouth Grill.
Go to Zoom Zoom: north.
Go to Firemouth Grill: west 3rd left 2nd left 1st right.
Go to Trunkers: west 1st left 1st right.
Switch to plan "g".

[h]
[ Copy Sunny Skies Park to Trunkers and add it to Firemouth Grill ]
Go to Sunny Skies Park: north 1st right.
Switch to plan "i" if no one is waiting.
Pickup a passenger going to Cyclone.
Go to Firemouth Grill: south 1st left 1st left 1st right.
Pickup a passenger going to Addition Alley.
Go to Cyclone: west 1st left 1st right 2nd right.
Pickup a passenger going to Addition Alley.
Pickup a passenger going to Trunkers.
Go to Zoom Zoom: north.
Go to Trunkers: west 3rd left.
Go to Addition Alley: west 2nd right 2nd right 1st right.
Pickup a passenger going to Narrow Path Park.
Go to Narrow Path Park: north 1st right 1st left 1st right.
Go to Cyclone: west 1st left 1st right 2nd left.
Switch to plan "h".

[i]
[ } // End of 'while (B(0) != null)' up near plan "e" ]
Go to Trunkers: south 1st left.
Pickup a passenger going to Knots Landing.
Go to Knots Landing: east 1st right 2nd left 5th right.
Go to Trunkers: west 1st left 3rd right 1st left.
Switch to plan "j" if no one is waiting.
Go to Firemouth Grill: east 1st left 1st right.
Switch to plan "e".

[j]
[ // Check each possible sum to see if it equals T ]
[ N = 0;                                           ]
[ while (D(0) != null) {                           ]
[    if (D(0) = T) { N++; }                        ]
[    D.shift();                                    ]
[ }                                                ]
[ Set N = 0 ]
0 is waiting at Starchild Numerology.
Go to Starchild Numerology: west 1st left 2nd left.
Pickup a passenger going to Addition Alley.

[k]
[ Pickup T ]
Go to Rob's Rest: west 1st right 2nd left 1st right.
Pickup a passenger going to Cyclone.
Go to Cyclone: south 1st left 1st left 2nd left.
Pickup a passenger going to Rob's Rest.
Pickup a passenger going to Equal's Corner.
Go to Zoom Zoom: north.
Go to Rob's Rest: west 2nd left 2nd right 1st right.
Go to Narrow Path Park: south 1st left 1st left 1st right 1st right 2nd left 5th left.
Switch to plan "o" if no one is waiting.

[ Check the next value against T ]
Pickup a passenger going to Equal's Corner.
Go to Equal's Corner: west 1st left 1st right 2nd left 1st left.
Switch to plan "l" if no one is waiting.

[ It's a match so N = N + 1 ]
Pickup a passenger going to Knots Landing.
1 is waiting at Starchild Numerology.
Switch to plan "m".

[l]
[ It's not a match so N = N + 0 ]
0 is waiting at Starchild Numerology.

[m]
Go to Starchild Numerology: north 1st right.
Pickup a passenger going to Addition Alley.
Go to Addition Alley: west 1st right 3rd right 1st right 1st right.
Pickup a passenger going to Addition Alley.
Go to Knots Landing: north 1st right 2nd right 1st left.
Go to Starchild Numerology: west 1st left 3rd right 1st left 1st left 2nd left.
Switch to plan "k".

[o]
[ // If we found the desired number of sums, ouput and break ]
[ // Otherwise, go to the next T and keep going              ]
[ if (N = S) {                                               ]
[    print(T);                                               ]
[    break;                                                  ]
[ } else {                                                   ]
[    T++;                                                    ]
[ }                                                          ]
[ T is still going to Equal's Corner so just get rid of it ]
0 is waiting at Starchild Numerology.
Go to Starchild Numerology: west 1st left 1st right 2nd left 1st left 3rd left.
Pickup a passenger going to Equal's Corner.
Go to Equal's Corner: west 1st left.

[ N is still going to Addition Alley so redirect it to Equal's Corner ]
Go to Addition Alley: north 4th right 1st right 1st right.
Pickup a passenger going to Equal's Corner.

[ Compare N = S ]
Go to Bird's Bench: north 1st left 1st left 1st left 2nd right 1st left.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st right 1st left 2nd left.
Pickup a passenger going to Bird's Bench.
Pickup a passenger going to Equal's Corner.
Go to Bird's Bench: north 1st right 2nd right 1st left.
Go to Equal's Corner: north 1st right 1st right.
Switch to plan "p" if no one is waiting.

[ It's a match! The value we want is T, waiting at Rob's Rest. ]
[Go to Rob's Rest:n 3 l 1 r.]
Go to Starchild Numerology: north 1st right.
Go to Rob's Rest: west 1st right 2nd left 1st right.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st left 1st right 1st right 1st right.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st left 1st right.
Switch to plan "z".

[p]
[ It's not a match. T = T + 1 and start over. ]
1 is waiting at Starchild Numerology.
Go to Starchild Numerology: north 1st right.
Pickup a passenger going to Addition Alley.
Go to Rob's Rest: west 1st right 2nd left 1st right.
Pickup a passenger going to Addition Alley.
Go to Addition Alley: south 1st left 1st left 2nd right 1st right 1st right.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st left 1st left.
Pickup a passenger going to Rob's Rest.
Pickup a passenger going to Cyclone.
Go to Rob's Rest: north 1st right 2nd right 1st right.
Go to Cyclone: south 1st left 1st left 2nd left.
Switch to plan "a".

[z]
[ Terminate program with 10 less bytes than going back to the Taxi Garage ]


Write a Stepping Quine Related

Your goal, is to write a set of programs, that progresses from one to the other, one character at a time. For example. Given the starting program abcd and the ending program wxyz, you should have 5 valid programs, with the respective outputs.

abcd -> wbcd
wbcd -> wxcd
wxcd -> wxyd
wxyd -> wxyz
wxyz -> wxyz

As can be seen, the last program should be a quine.

Rules

Your start and end program may be any length, And they may also be different lengths
Your start and end program must contain entirely unique characters at each position, but may share characters overall.
Each program should affect a single character at a time, in any order, characters should only be added or removed from the end of the program.
None of your programs need to follow the valid quine rules, they only need to output the correct string.
Standard Loopholes Apply.

Scoring

Programs are scored by the length of the start program plus the length of the end program in bytes. In the previous example, 4 + 4 = 8, so the score is eight. This is code-golf, so shortest programs wins.

Some Valid Programs

In languages that hopefully don't exist

abcd -> dbcd -> dccd -> dcbd -> dcba
a -> b
a -> b -> bc -> bcd -> bcde
ab -> aa -> ba
[BLANK PROGRAM] -> a
xyz -> xy -> x -> [BLANK PROGRAM]

Retina, Score 1

Try it online!

The empty program outputs 1, since the empty input matches the empty string exactly once.
1 outputs 0, since 1 doesn't match the empty input.
0 outputs 0, since 0 doesn't match the empty input. Since it outputs itself, it's a quine (as defined in this challenge).