text:
Error 404: Character Not Found
Scenario
One of your friends is struggling on a homework assignment. He needs a simple program which prints the first 404 natural numbers:
1 2 3 4 5 6 7 8 9 10 11 ... 401 402 403 404

Your challenge is simple: write this program for him.
However, your connection is terrible, so 1 random character is lost every time you send the program. To prevent this from breaking your program, you must make it so that removing any single character will have no effect: the program works, regardless. (The original program must also work.)
Because the connection is too poor to send large files, your code must be as short as possible.
TL:DR - make a radiation hardened program to output the numbers 1 to 404

Rules/Details

The output may be a list of integers in any reasonable format (separated by spaces, newlines, commas, etc). However, your output must be consistent and not change when the program is modified.
Command line flags that contain logic, execute actual code, generate the number list, and so on, are banned.
This is code-golf, so the shortest submission (in bytes) wins!

Related.

Related

Are command-line flags subject to radiation (e.g. Perl's -p flag)?

The -p flag wraps the program in while(<>){ ... ; print$_}.  Does that count as logic?

@GabrielBenamy I'd say it does, sorry

Can errors be ignored if the program still prints 1 - 404?

@jrich yep, stray error output is allowed by default :)

Maybe there should be a tag like [tag:radiation-hardering]?

Voting to close, we are not doing your homework for you XD

@ケセブロト crap, you got me.

05AB1E, 12 bytes
Code:
XX440044ÔÔŸŸ

Normal code explanation:
X             # Pushes the number 1.
 X            # Pushes the number 1 again.
  440044      # Pushes the number 440044.
        Ô     # Connected uniquify.
         Ô    # Connected uniquify.
          Ÿ   # Inclusive range of the top two elements.
           Ÿ  # Inclusive range on the array, which leaves it intact.

This leads to the following golfed code: X404Ÿ, which is what we want to achieve.
The number 404 is generated by any of these variants:
440044ÔÔ
40044ÔÔ
44044ÔÔ
44004ÔÔ
440044Ô

The inclusive range works as following on two numbers:
`1 5Ÿ`             ->    [1, 2, 3, 4, 5]
[1, 5]Ÿ            ->    [1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]Ÿ   ->    [1, 2, 3, 4, 5]

Which always makes the second Ÿ a no-op.
Uses the CP-1252 encoding. Try it online!

JavaScript, 228 bytes
etInterval=stInterval=seInterval=setnterval=setIterval=setInerval=setIntrval=setInteval=setInteral=setIntervl=setInterva=top=>4

setInterval
`405>(i=this.i?i:1)?alert(i++):0`///`
setInterval
`405>(i=this.i?i:1)?alert(i++):0`///`

Explanation
Evaluating code in a setInterval allows the program to continue even if there is an error. We make sure that the code passed will error out if any single character is removed. Template string syntax can be abused to call setInterval with a constant string without parentheses. Luckily, even if the template string is on the next line it still parses as a function call with such syntax.
The first issue we run into is that setInterval is a function, and thus if a character is removed and the program tries to call setInteval instead, it errors out. Of course, since there are two indentical invocations of the setInterval, we don't have to worry about it actually functioning correctly as long as we avoid the error. So, the first line defines every possible "misspelling" of setInterval to a valid function.
The first line works by assigning all of these "misspellings" to the function top=>4. Note the ES6 syntax, this simply takes a paramater named "top" and returns 4. Why "top"? Well, the first line must never throw an error even if a character is removed. If an = is removed to make top>4, this boolean expression will be valid since top is predefined in browsers, simply yielding false. If the 4 is removed, the function body simply becomes the first setInterval segment, and the second runs unharmed.
Now, all that is left to worry about is if a ` is removed.
If removed from the beginning, setInterval simply does nothing, evaluating to itself as its own expression. Then, the rest of the second line simply runs a single iteration of the loop, letting the other setInterval fragment finish the job. If removed from the end, the remaining backtick is picked up from the end of the comment.
The newlines are placed so that removal one will not affect program behavior, but they prevent errors in the case of some character removals such as the leading backtick.

I pondered what would break if one of the digits in a 405 were removed, but then I realized: nothing, because either all 404 numbers have already been printed, or the second loop will print the missing ones. Spectacular work.

What happens if part of "top" gets lost?

@Scimonster It still parses as a function, returning 4, just with the unused parameter named "to" or "op" or "tp"

@jrich of course. Brain cramp. :P

What happens if you lose part of this?

@wat Causes an error trying to access a property of an undefined variable such as "ths", which doesn't halt the program execution due to the setInterval.

@jrich

you must make it so that removing any single character will have no effect

@wat OP has clarified that stray error output is ok.

Pyth - 16 bytes
The basic idea behind this is that when you take a digit off of 404, it only makes the number smaller, so we just have to get the maximum of two 404's to ensure we have the right number. Obviously, there are a bunch more redundancies.
SSsetSS[404  404

Explanation:
SS                       First one does 1-index range, second one sorts, which is no-op
 s                       If the e is there, this is no-op, if only t is there, it sums a one element list, which is the item
  et                     e picks last element in list, and if e is gone, then t gets you the list without the first element which is good enough when combined with s
   SS                    Sorting twice is no-op
    [                    Start list, this can't be two element because if we get rid of initial 4, the 0 becomes third element which neeeds to be captured
     404                 One of the 404's
     <space><space>404   Need two spaces for redundancy, because 404404 *is* bigger than 404

Try it online here.

Befunge-98, 37 bytes
20020xx##;;11++::''ee44**``kk@@::..;;

Try it online!
Explanation
Making radiation-hardened code in Befunge-98 isn't too bad, because you can set the "delta" (i.e. the step size of the instruction pointer) manually with x. So if set the delta to (2,0), from then on every other character is skipped and we can simply double up all commands. The tricky thing is getting 2 0 on top of the stack in a reliable way. We'll actually need 0 2 0 for the rest the program to work correctly, but we'll that for free. Here is how we do this:
20020xx

Note that each digit pushes itself, so in the full program, there will be a start 2 0 which we'll simply ignore.
Consequently, dropping either the first or second character from the program is irrelevant because we won't use those digits anyway. Likewise, removing the third character is identical to removing the second, so we don't need to worry about that either.
Let's consider what happens in the other two cases. Dropping the fourth character:
2000xx

Note the delta is set to (0,0). But this doesn't move the instruction pointer at all, so the same x is executed again immediately and this time pops the (2,0) and all is well (there are implicit zeros at the bottom of the stack for our later purposes).
Let's drop the fifth character instead:
2002xx

Now the delta gets set to (0,2). However, there is still no horizontal movement, so the IP wraps immediately back to x and again, the correct delta gets set.
From this point onward we can basically ignore the character duplication as well as this initial part because it will always be skipped:
...#;1+:'e4*`k@:.;

The ; is a sort of comment command which skips everything until the next ; is encountered. However, we jump over the first ; with # so only the part between the ; will be executed from that point onward.
1+    Increment the top of the stack.
:     Duplicate it.
'e    Push 101.
4*    Multiply by 4 to get 404.
`     Greater-than check. Pushes 1 once the top
      reaches 405, otherwise 0.
k@    Terminate the program that many times.
:.    Print a copy of the top of the stack (and a space).

><>, 103 60 51 bytes
               vv
;?=*4o" e"n:ll<<
;?=*4o" e"n:ll<<

Tested here.
Uses the same tactic as this program. If a character is deleted in the first line, the 2nd line will still be run. If a character in the 2nd line is deleted, the v will move execution to the 3rd line, since the 2nd line is a character shorter. A deletion in the 3rd line has no effect on program control, as it is only execution after a deletion in line 2.
The program will also work in the event that a line break is deleted:
Case 1:
The 2nd line will be run.
               vv;?=*4o" e"n:ll<<
;?=*4o" e"n:ll<<

Case 2:
Both lines become one line with twice the instructions.
               vv
;?=*4o" e"n:ll<<;?=*4o" e"n:ll<<

Explanation:
The core of the program is the following. Note that a 1 is pushed on the stack already by the first line.
ll:n        Push length of the stack twice, duplicate, print as number
"e "o       Push 101, 32, output 32 as space
4*          101 * 4 is 404
=?;         Pop twice, if equal, halt
            (Execution wraps around)

Can you use o" e"?

And instead of +1 you can use l. Also the fishlanguage.com interpreter is a bit weird (and annoying to use, although the debugging feature is useful of course). TIO uses the somewhat saner Python interpreter, I think: https://tio.run/nexus/fish#@m9oqIAMysq4AMuxtrfVMslXUkhVssqzsrHBEPj/HwA

@MartinEnder That doesn't work if you remove one of the  1s on the first line.

Ah right, those were bothering me anyway: https://tio.run/nexus/fish#@q@ACsrKuKztAbPVMslXUkhVysnLybGxwRD4/x8A

><>, 42 38 34 bytes
Try it Online!
Thanks to @Martin Ender and @Teal Pelican for shaving off 8 bytes!
<<;?=*4o" e"lnll/
 ;?=*4o" e"lnll<

Similar to mbomb007's answer, but only uses 2 lines.
Instead of counting up from 1 to 404 using a single memory value, I continuously pushed the length of the stack. This made it so that I didn't need to put anything on the stack before the loop started, making things a lot easier.
The original code
The <s turn the IP around, and the / is a no-op, as the IP wraps around and continues along it's normal path. Thus, the relevant code is:
          lnll   Prints the size of the stack + 1 and pushes the stack size twice
     o" e"       Prints a space and pushes 101
   *4            Multiplies to get 404
;?=              If the number we just printed was 404, end the program

And this repeats.
The deletion
The big key here is the mirror /. It doesn't do anything if the second line is modified - only wraps back around to itself and is essentially a no-op. But if a character from the first line is removed, the line will shift down, so that the mirror hits the arrow <, leading into an identical, unmodified loop.
The only other significant deletion would be the \n character. This is also accounted for, as it produces this code:
<<;?=*4o" e"lnll/ ;?)*4o" e"lnll<

Now, we have just appended a copy of the original loop ;?=*4o" e"lnll to itself. As this is a loop, it makes no difference to the execution, and runs as if nothing had changed.

Really nice way to reduce it to 2 lines. The only problem I can see is that it's not 38 bytes but 42? Reducing the inner code to; ;?=4o" e":n:+1l would reduce it down to 38 bytes though. This just places your 84 within the string " e" instead of separate.

You can also replace the :+1 and the other : with one l each.

Yes, thank you both!

;?=*4o" e"n:ll works too.

A Pear Tree, 34 bytes
The program contains control characters, so here's an xxd dump:
00000000: 7072 696e 7420 312e 2e34 3034 2327 108a  print 1..404#'..
00000010: af70 7269 6e74 2031 2e2e 3430 3423 2710  .print 1..404#'.
00000020: 8aaf                                     ..

A Pear Tree is basically a Perl derivative, with some "interesting" features. I threw it together as a joke (so that I could say that my polyglot printed a partridge in A Pear Tree; in fact, almost all programs do). However, it's Turing-complete, and actually kind-of good at this sort of challenge.
The feature that we mostly care about here is that A Pear Tree will only run a program if some substring of the code has a CRC-32 of 00000000. The code gets rotated to put the substring in question at the start. As it happens, the two (identical) halves of the code each have the CRC-32 in question (due to that suspicious-looking binary comment at the end), so if you delete a character from the source (breaking the CRC), the other half gets rotated to the start and the # sign near the end will comment the damaged half out, in addition to the binary junk.
Another feature makes the program slightly smaller: although A Pear Tree is mostly interpreted as Perl, it has some minor changes to make it work more like Python. One that's relevant here is that unlike Perl's print statement (which just runs the numbers together), A Pear Tree's print statement separates arguments with spaces and prints a final newline. That gives us nicely space-separated output, meaning that we don't have to waste bytes on formatting. (Note that you'll have to give the program no input; if the language receives input, it assumes by default that it's supposed to do something with it.)
Of course, this can't compete with actual golfing languages (nor would I expect it to), but I thought people might find it interesting.

Befunge 98, 34 bytes
Try it Online!
<<.:@k`*4e':+1[

2.:@k`*4e':+1<^^j

This works very similarly to my ><> answer, but instead of the mirror /, I use the turn left operation [ and then reverse the IP direction, which is functionally equivalent to a mirror in this case.
The original code
<<                 Reverses code direction, sending IP to right
               [   Turns the IP left, into the ^, which reverses it.
                   It then hits this again, turning left to go West. (No-op)
            :+1    Adds 1 to the sum
        *4e'       Pushes 404
     @k`           Ends the program if (sum > 404)
   .:              Prints the sum

The deletion
If something in the second line is deleted, it will shift over, and not affect the top at all.
If anything in the first line is deleted, the [ will send the IP into the <, which starts an identical loop (with the exception of 2j^^ which avoids the ^s used in tandem with the [)
Because there are 2 new lines, it makes no difference to the code if one is deleted (thanks to @masterX244 for this!)

what happens to empty lines in the code?. Maybe you could double the linefeed to make it immune, too

You're completely correct @masterX244 thanks! Didn't think about that.

lol, never used the language at all but for some reason a 6th sense gave me that idea...

JavaScript + HTML + Stack Snippets, 167 158 154 bytes
Abusing the fact that JavaScript in Stack Snippets gets placed in a web page inside a <script> element.

or(x="",i=405,d=document;--i;)d[i]||(x=d[i]=i+' '+x);d.write(x)</script></script><script>for(x="",i=405,d=document;--i;)d[i]||(x=d[i]=i+' '+x);d.write(x)

Befunge-93, 54 51 bytes
Thanks to Mistah Figgins for saving me 3 bytes.
111111111111111vv
+1_@#-*4"e":.:<<
+1_@#-*4"e":.:<<

Try it online!
This is essentially the same trick as was used in the Fault-Tolerant Hello World challenge. The first line starts by making sure there is a 1 on the top of the stack for the start of the sequence, and then one of the v arrows at the end of the line redirects the code path to the start of the main routine on line 2, executing from right to left.
Removing a character from the first line will just shift the v arrows across by one, but that still allows the code to redirect to the second line successfully. Removing a character from the second line causes the < arrow at the end of the line to shift out of the path of the v above it, so the code path will be redirected to the backup routine on line 3.
Removing the first line break does no harm, because that just moves the third line into place to replace the second line. And removing anything after the end of the second line will have no effect, because that's just the backup code.

The first line starts by making sure there is a 1 on the top of the stack... The first line is pretty sure of itself in that respect. Also, you can shorten the @#!</code> to @#-` and put it before the printing to save 3 bytes.

Actually, 18 bytes
:404::404kMkMMRRSS

Actually is a stack based golfing language.
Explanation of the commands involved (as they work in the above context):
Numbers are indicated by round brackets () and lists by square brackets []

:         - pushes the longest string of characters in '0123456789+-.ij' as a numeric
k         - pop all the elements on the stack into a list [l] and push [l]
M         - pop [l], push max([l])
            pop (a), push (a)
R         - pop [l], push reverse([l])
            pop (a), push range([1,a])
S         - pop [a], push sorted([a])

Zsh, 26 bytes
>404
>404

seq  ???||seq *

Try it online!
Verify all mutations!
Explanation:

>404: create the file 404. This command is repeated twice because if one has had a byte removed, we need the other to still work. Ordinarily with > you wouldn't need the newline between them, but in the case the second > is removed, >404404 wouldn't create 404

???: find a 3-character file name in the current directory (this will always find 404 because of the redundancy above)

seq: count up to that

||: if that fails (happens if seq or ??? is mangled):

*: find a filename
seq: count up to it

The second newline before the first seq is necessary because otherwise >404seq would create two files, and then seq * would try to range between 404 and 404seq, which isn't a number

The second space in seq  ??? is necessary because seq??? would fail to match, and for some reason the bit after the || doesn't get executed either (it's possibly a bug in zsh)

If any of the two |s are missing, the first seq is piped to the second; the second ignores its input, but still outputs as normal.

Vyxal, 11 9 bytes
-2 thanks to A username
⁺ed404∴ɾƛ

Try it Online!
⁺ed404∴ɾƛ
⁺e          # Push 202
  d         # Double ^ to get 404
   404      # Push 404 again
      ∴     # Take the maximum
               # If bytes are removed from either of the 404s, this ensures the intact one is pushed
               # If ∴ is removed, 404 is still at the top of the stack so it doesn't matter
       ɾ    # range(1, n+1)
        ƛ   # Map
               # If it's a number (ɾ removed), range(1, n+1) is used
               # Otherwise (it's a range), nothing happens here

9

Gol><>, 26 bytes
<<;|N:PF*4e`/
<;|N:PF*4e`/

Try it online!
This is pretty simple, but there wasn't a Gol><> answer yet, and it scores pretty well.

Klein 000, 32 bytes
<<@?+-*4"e":+1:/
<@?+-*4"e":+1:/

Try it online!
Klein XXX, 54 bytes
>>>             \\
..\:+1:@?+-*4"e"<
\..:+1:@?+-*4"e"<

Try it online!
Shamelessly reusing strategies from my fault tolerant "Hello world" solution.


text:
Number of Straight-Chain Alk*nes of given length
A straight-chain alk*ne is defined as a sequence of carbon atoms connected by single (alkane), double (alkene), or triple bonds (alkyne), (implicit hydrogens are used.) Carbon atoms can only form 4 bonds, so no carbon atom may be forced to have more than four bonds. A straight-chain alk*ne can be represented as a list of its carbon-carbon bonds.
These are some examples of valid straight-chain alk*nes:
[]       CH4              Methane
[1]      CH3-CH3          Ethane
[2]      CH2=CH2          Ethene
[3]      CH≡CH            Ethyne
[1,1]    CH3-CH2-CH3      Propane
[1,2]    CH3-CH=CH2       Propene
[1,3]    CH3-C≡CH         Propyne
[2,1]    CH2=CH-CH3       Propene
[2,2]    CH2=C=CH2        Allene (Propadiene)
[3,1]    CH≡C-CH3         Propyne
[1,1,1]  CH3-CH2-CH2-CH3  Butane
...

While these are not, as at least one carbon atom would have more than 4 bonds:
[2,3]
[3,2]
[3,3]
...

Your task is to create a program/function that, given a positive integer n, outputs/returns the number of valid straight-chain alk*nes of exactly n carbon atoms in length. This is OEIS A077998.
Specifications/Clarifications

You must handle 1 correctly by returning 1.
Alk*nes like [1,2] and [2,1] are considered distinct.
Output is the length of a list of all the possible alk*nes of a given length.
You do not have to handle 0 correctly.

Test Cases:
1 => 1
2 => 3
3 => 6
4 => 14

This is code golf, so lowest byte count wins!

just to clarify, a chain is valid if all consecutive pairs are summed to <=4, right?

Fixed. @Maltysen: yes.

Why is there an OEIS sequence for everything? :P

Is 0-indexing (like the OEIS sequence does) okay?

@Emigna, to fix things just insert a(0) = 1. To be honest, I think that should be a required test case in this question.

0 doesn't matter, but if I included it, it would be 0: because nothing isn't even a molecule.

@ZacharyT, there is precisely one hydrocarbon with zero carbon atoms, and it's the one which also has zero hydrogen atoms. It's the exact same argument as for Pascal's triangle having a 1 at the top rather than a 0, or for literally hundreds of other combinatoric sequences.

@PeterTaylor: I did an initial value for a(0) (at no extra cost in bytes). I just wondered if it was necessary as the OEIS sequence linked is 0-indexed.

@Emigna, that's because the wrong sequence was linked. I'll correct it.

Oasis, 9 7 bytes
xcd-+3V

Try it online!
Explanation
This uses the recurrence relationship in OEIS:

a(n) = 2*a(n-1) + a(n-2) - a(n-3)

x    Multiply a(n-1) by 2: gives 2*a(n-1)
c    Push a(n-2)
d    Push a(n-3)
-    Subtract: gives a(n-2) - a(n-3)
+    Add: gives 2*a(n-1) + a(n-2) - a(n-3)
3    Push 3: initial value for a(n-1)
V    Push 1, 1: initial values for a(n-2), a(n-3)

Nice use of initial values! You win this time ;)

Yeah, there's probably no way to beat this.

@ZacharyT Only if somebody can figure out a way to make the program have xkcd in it.

@hBy2Py Well, xkcd-+311 works, because k is currently a no-op...

MATL, 10 bytes
7K5vBiY^1)

Try it online!
Explanation
This uses the characterization found in OEIS

a(n) is the top left entry of the n-th power of the 3 X 3 matrix [1, 1, 1; 1, 0, 0; 1, 0, 1]

7    % Push 7
K    % Push 4
5    % Push 5
v    % Concatenate all numbers into a column vector: [7; 4; 5]
B    % Convert to binary: gives 3×3 matrix [1, 1, 1; 1, 0, 0; 1, 0, 1]
i    % Input n
Y^   % Matrix power
1)   % Take the first element of the resulting matrix, i.e. its upper-left corner.
     % Implicitly display

Oasis, 9 8 bytes
Saved a byte thanks to Adnan
xc+d-63T

Try it online!
Explanation
a(0) = 0
a(1) = 1
a(2) = 3
a(3) = 6

a(n) = xc+d-

x         # calculate 2*a(n-1)
 c        # calculate a(n-2)
  +       # add: 2*a(n-1) + a(n-2)
   d      # calculate a(n-3)
    -     # subtract: 2*a(n-1) + a(n-2) - a(n-3)

Nice! Also, x is short for 2* :).

Beat ya :-P (I hadn't seen there already was an OASIS answer)

@Adnan Is there a way to tell Oasis that you want to shift the output sequence index by 1? I mean, subtract 1 to the input argument (instead of using an initial 0 here)

@LuisMendo Ah, that isn't implemented yet. But it's a good idea for the next release :).

For future reference, this is now implemented

Jelly, 10 bytes
745DBæ*µḢḢ

Try it online!
Uses Luis Mendo's algorithm.
Explanation
745DBæ*µḢḢ    Main link. Argument: n
745D          Get the digits of 745
    B         Convert each to binary
     æ*       Matrix power
        ḢḢ    First element of first row

Jelly, 15 bytes
3Rṗ’µ+2\<5PµÐfL

Try it online!
Uses brute force.
Explanation
3Rṗ’µ+2\<5PµÐfL    Main link. Argument: n
3R                 Start with [1, 2, 3]
   ’               Take the (n-1)'th
  ṗ                Cartesian power
            Ðf     Filter on:
     +2\             Sums of overlapping pairs
        <5           1 for sums < 5, 0 otherwise
          P          Product: 1 if all pairs < 5
              L    Length

MATL, 14 bytes
q3:Z^TTZ+!5<As

Try it online!
Explanation
This generates the Cartesian power of [1 2 3] "raised" to the number of atoms minus 1, and then uses convolution to check that no two contiguous numbers in each Cartesian tuple sum more than 4.
q    % Take number of atoms n implicitly
3:   % Push [1 2 3]
Z^   % Cartesian power. Gives a matrix with each (n-1)-tuple on a row
TT   % Push [1 1]
Z+   % 2D convolution. For each tuple this gives the sum of contiguous numbers
5<   % For each entry, gives true if less than 5
!    % Transpose
A    % True if all elements of each column are true. Gives a row vector
s    % Sum of true results. Implicitly display

Python, 51 bytes
f=lambda n:n<4and(n*n+n)/2or 2*f(n-1)+f(n-2)-f(n-3)

This is a straightforward implementation of the recurrence relation. Thanks to Tim Pederick for 3 bytes. The output is a float in Python 3 and an integer in Python 2.
Try it online!

(n*n+n)/2 is shorter than [1,3,6][n-1]. And if you're using Python 3 and don't like ending up with floating-point output, (n*n+n)//2 is still shorter.

Mathematica, 48 bytes
MatrixPower[{{1,1,1},{1,0,0},{1,0,1}},#][[1,1]]&

As Luis Mendo pointed out, this is A006356 in the OEIS. Here are my original attempts:
Count[Length@Split[#,+##<5&]&/@Tuples[{1,2,3},#-1],0|1]&

For an input n, Tuples[{1,2,3},n-1] is the list of all (n-1)-tuples of elements in {1,2,3} representing all possible sequences of single, double, or triple bonds for n carbon atoms. +##<5& is a pure function which returns whether the sum of its arguments is less than 5, so Split[#,+##<5&]& splits a list into sublists consisting of consecutive elements whose pairwise sums are less than 5. Describing a valid alk*ne is equivalent to this list having length 0 (in the case where n=1) or 1, so I just Count the number of (n-1)-tuples where the length of that list matches 0|1.
Count[Fold[If[+##>4,4,#2]&]/@Tuples[{1,2,3},#-1],Except@4]&

If[+##>4,4,#2]& returns 4 if the sum of its arguments is greater than 4 and returns the second argument otherwise. Fold[If[+##>4,4,#2]&] does a left Fold of its input with this function. So here I Count the number of (n-1)-tuples to which applying this operator doesn't give 4. The case where n=1 is covered since Fold remains unevaluated when its second argument is the empty list {}.

Would this work? (Kind of ripped right from OEIS with adjustments) LinearRecurrence[{2,1,-1},{1,3,6},#][[#]]&?

Part of why I love this site is learning all of the features Mathematica has to offer :)

By this site, do you mean OEIS or PPCG?

PPCG. I've picked up alot of Mathematica from people's suggestions.

Mathematica, 42 40 bytes
Byte count assumes a compatible single-byte encoding like CP-1252 (the default on Windows installations).
±0=±1=1;±2=3;±n_:=±(n-1)2+±(n-2)-±(n-3);

This simply implements the recurrence given on OEIS as a unary operator.

CJam (19 bytes)
{2,{__-2=+1b+}@*W=}

Online test suite. This is an anonymous block (function) which takes one item on the stack and leaves one on the stack. Note that the test suite includes a(0) = 1.
The recurrence used is based on the observation for the related OEIS sequence A006356:

Equals the INVERT transform of (1, 2, 1, 1, 1,...) equivalent to a(n) = a(n-1) + 2*a(n-2) + a(n-3) + a(n-4) + ... + 1. a(6) = 70 = (31 + 2*14 + 6 + 3 + 1 + 1). - Gary W. Adamson, Apr 27 2009

but with the appropriate offset, which removes the need for the final + 1 as now covered by a(0).
Dissection
{         e# Define a block
  2,      e#   Take starting sequence [0 1] (beginning at index -1 for golfiness)
  {       e#   Loop...
    _     e#     Copy sequence so far
    _-2=+ e#     Append an extra copy of a(n-2)
    1b    e#     Sum
    +     e#     Append
  }@*     e#   ...n times
  W=      e#   Take the final value from the sequence
}

Brain-Flak, 56 bytes
Uses the algorithm detailed in the first comment on the OEIS page.
Try it online!
({}[()]<(((())))>){({}[()]<{({}<>({}))<>}<>>)}{}({}<>{})

Explanation
The sequence can be defined as such:
For u(k), v(k), and w(k) such that
u(1) = v(1) = w(1) = 1
u(k+1) = u(k) + v(k) + w(k)
v(k+1) = u(k) + v(k)
w(k+1) = u(k)
u(k) is the number of straight-chain alk*nes with length k

The program starts at 1 and repeatedly applies this recurrence to calculate u(k)
Annotated Code (actual annotation to come)
# Setup: decrement the input by one and push three 1's to the stack under it
({}[()]<(((())))>)

# Calculation:
{                          }           # While the input is not zero (main loop)
 ({}[()]                  )            # Pop the counter decrement it by one and push it
        <                >             # Before the counter gets pushed back to the stack...
         {            }                # Loop while the top of the stack is not zero (subloop)
          (        )                   # Push...
           {}                          # The top of the stack (popped)...
             <>                        # to the other stack...
               ({})                    # plus the top of the other stack (peeked)
                    <>                 # Switch back to the first stack.
                       <>              # Switch to the other stack
                            {}         # Pop the input (now zero)
                              (      ) # Push...
                               {}      # The top of the stack (u(k))...
                                 <>    # to the other stack...
                                   {}  # plus the top of the other stack (zero).

Visualization of the stacks
In one iteration of the main loop this is what happens (note that the zeros may or may not be present but it does not matter either way):
Start of main loop iteration/subloop first iteration:
A    B

u
v
w
0    0
^

After first subloop iteration:
A    B

v
w    u
0    0
^

After second subloop iteration:
A    B

    u+v
w    u
0    0
^

After third subloop iteration (top of stack is zero so subloop terminates):

A    B

   u+v+w
    u+v
     u
0    0
^

End of main loop iteration:
A    B

   u+v+w
    u+v
     u
0    0
     ^

The state of the stacks is now the same as it was at the start of the loop except that the current stack now has the next values for u, v, and w on it.

Perl 6, 48
{my @a=1,0,0;@a=reverse [\+] @a for 1..$_;@a[0]}

Originally
sub f {$_>2??2*f($_-1)+f($_-2)-f($_-3)!!(1,1,3)[$_]}

but I forgot I needed the sub f so the iterative solution wins out.

Pyth - 16 bytes
Uses brute force.
lf.AgL4+VTtT^S3t

Test Suite.

It would be nice to provide a description for those of us who don't "grok" Pyth.

Dyalog APL, 30 bytes
{⍵<3:⍵⌷1 3⋄+/∧/¨4≥2+/¨,⍳1↓⍵/3}

Uses brute force.
Explanation (my best attempt at one, at least):
⍵<3:⍵⌷1 3 - if ⍵ (function arg) is 1 (case 1) or 2 (case 2), return 1 (case 1) or 3 (case 2)
⋄ - separate statements
⍵/3 - otherwise, 3 repeated ⍵ times
1↓ - without the first element
⍳ - the matrix of possible indices of a matrix of that size
,  - ravel, return a list of all the elements of the matrix
2+/¨ - sum of each contiguous pair on each element
4≥ - tests whether each element is less than or equal to 4
∧/¨ - all elements are true, applied to each item.
+/ - Sum.

Ruby, 62 bytes
->n{c=0
(10**n/10).times{|i|"#{i}#{i*11}"=~/[3-9]/||c+=1}
c}

Horribly inefficient base 10 brute force approach. Could be improved to base 5 for additional bytes.
Numbers are generated where each digit represents a bond (n-1 digits.) 0 represents a bond order of 1, 2 represents a bond order of 3. Digits over 2 are invalid.
We multiply this by 11 to sum adjacent pair of digits. Again digits over 3 are invalid.
We combine the two numbers in a string and perform a regex to search for invalid digits. If none are found, we increment the counter.
in test program
f=->n{c=0
(10**n/10).times{|i|"#{i}#{i*11}"=~/[3-9]/||c+=1}
c}

p f[gets.to_i]

Ruby, 51 bytes
->n{a=[1,1,3]
n.times{a<<2*a[-1]+a[-2]-a[-3]}
a[n]}

Based on the recurrence relation per OEIS A006356.
Starts with an array for elements 0,1 and 2 of the sequence which are 1 (as calculated by me, to make it work), 1 and 3 respectively.
Iteratively adds n more elements to the sequence, then returns element n. It always calculates 2 elements more than it actually needs to, but it's still linear time, which is way more efficient than my previous answer.
in test program
f=->n{a=[1,1,3]
n.times{a<<2*a[-1]+a[-2]-a[-3]}
a[n]}

p f[gets.to_i]

Python with Numpy, 62 bytes
I had to try it, but it seems pure Python and recursion is shorter than numpy and the explicit, matrix-based calculation on the OEIS page.
from numpy import*
lambda n:(mat('1 1 1;1 0 0;1 0 1')**n)[0,0]

R, 61 58 55 51 50 bytes
Takes input from stdin, uses matrix exponentiation to determine exact result.
el(expm::`%^%`(matrix(!-3:5%in%2^(0:2),3),scan()))

If you prefer a recursive solution, here's a straightforward implementation of the recurrence relation listed in OEIS, for 55 bytes.
f=function(n)`if`(n<4,(n*n+n)/2,2*f(n-1)+f(n-2)-f(n-3))

Dyalog APL, 29 bytes
{⍵<4:⍵⌷1 3 6⋄+/2 1 ¯1×∇¨⍵-⍳3}

Works by using the recursive definition of the integer sequence OEIS A006356.

Excel, 123 bytes
Implements the formula from OEIS:
=4*(SIN(4*PI()/7)^2*(1+2*COS(2*PI()/7))^A1+SIN(8*PI()/7)^2*(1+2*COS(4*PI()/7))^A1+SIN(2*PI()/7)^2*(1+2*COS(8*PI()/7))^A1)/7

As always, input in A1, formula in any other cell.
Dug up old Trig identities to see if could be helpful.  Now my head hurts.

Lithp, 79 bytes
#N:(((if(< N 4)((/(+ N(* N N))2))((-(+(* 2(f(- N 1)))(f(- N 2)))(f(- N 3)))))))

Implements recursive integer sequence listed in OEIS.
Readable implementation and test suite.
% alkaline.lithp
% run with: ./run.js alkaline.lithp
(
    (def f #N : ((
        (if (< N 4) (
            (/ (+ N (* N N)) 2)
        ) (else (
            (- (+ (* 2 (f (- N 1))) (f (- N 2))) (f (- N 3)))
        )))
    )))

    % Test cases 1 to 4
    (import lists)
    (each (seq 1 4) #I :: ((print (f I))))
)

MMIX, 44 bytes (11 instrs)
If passed 0, returns \$A077998(2^{64})\$ (if the computer doesn't break down).
Works mod \$2^{64}\$.
(jxd)
00000000: e3010001 e3020001 e3030003 27000001  ẉ¢¡¢ẉ£¡¢ẉ¤¡¤'¡¡¢
00000010: 28ff0302 26ffff01 c1010200 c1020300  (”¤£&””¢Ḋ¢£¡Ḋ£¤¡
00000020: c103ff00 5b00ffb5 f8020000           Ḋ¤”¡[¡”Ọẏ£¡¡

Disassembly and explanation:
alkns   SET   $1,1          // a(0)
        SET   $2,1          // a(1)
        SET   $3,3          // a(2)
0H      SUBU  $0,$0,1       // loop: n--
        2ADDU $255,$3,$2    // a' = 2a + a`
        SUBU  $255,$255,$1  // - a``
        SET   $1,$2         // a`` = a`
        SET   $2,$3         // a` = a
        SET   $3,$255       // a = a'
        PBNZ  $0,0B         // if(n) goto loop
        POP   2,0           // return a

source: Stack Exchange

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

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

sort: votes


text:
Verify my lasagne
Scenario
I often cook lasagne, but I also have a few mistakes. Since I repeat these faults so often, I thought I maybe could do a program that checks if I did everything right.
Valid lasagne
A valid lasagne is

At least 5 columns wide
At least 4 layers high

Excluding extra cheese

The top layer is cheese (represented by ,)
The second layer is sauce (represented by either @ or #)
After that the layers alternate (1 layer sauce, 1 layer noodles (represented by either ~ or -))
Each column can have either one or two layers of cheese

The program
Should

take a lasagne string as input

multiline string
string array
the string only contains the chars ,@#~-
Rectangular
Padded with spaces if necessary

Output whether it's a valid lasagne

Any thing that's thruthy in your language if valid
Nothing or anything that's falsy in your language

be either

a full program
a function
that only uses functionality that was implemented before the 14.12.2016

Test cases
,, ,
,,,,,,
@@@###
~~~~~-
@##@@#

--> truthy

@@@#
----
@@##
----
@###

--> falsy (cause of cheese and width (You don't have to print the stuff in the brackets))

,,,,,
-----
@####
-----
@@@@@

--> falsy (have the sauce as last layer)

Winning criteria
The

shortest

in bytes
code-golf

functional

submission wins.

Please close that parenthesis.

Question: Does it need to be horizontally rectangular? i.e. what if it is 10 rows high and 9 columns wide?

The spec says it can only ,@#~- with the exception of spaces as padding, but the first test case contains spaces in the middle of a line.

@feersum "Padded with spaces if necessary"

Retina, 38 34 bytes
Thanks to Grimy for saving 4 bytes.
Have a regex with your lasagne.
Byte count assumes ISO 8859-1 encoding.
^([, ]+¶)?,{5,}(¶[@#]+¶[-~]*){2,}$

Assumes that the input ends with a trailing linefeed. Prints 1 (match) for valid lasagnes and 0 (no match) for invalid ones.
Try it online!
Explanation
This is just a standard .NET regex matched against the input, except that Retina provides the alias ¶ for linefeeds or \n.
Since the input is guaranteed to be rectangular, we only need to check the width of the lasagne on one of the rows.
^           # Anchor the regex to the beginning of the input.
([, ]+¶)?   # Match an optional first line of only commas an spaces.
,{5,}       # Match at least 5 commas.
(           # Match this at least twice to ensure at least two layers of sauce.
  ¶[@#]+    #   Match a line of sauce.
  ¶[-~]*    #   Match a line of pasta. This line may be empty (which would
            #   indicate the end of the input.
){2,}
$           # Make sure we've indeed reached the end. Note that `$` can
            # match either at the very end of the input, or in front of
            # the trailing linefeed.

If we’re allowed to assume that there’s a final linefeed after the last line (which sounds reasonable), you can use ¶[-~]* instead of (¶[-~]+|$), saving 4 bytes.

@Grimy Ah good catch, thank you!

Grime, 43 bytes
e`[ \,]+/?/(\,/[#@]^/[\-~]/+/[#@]/?)+{5-,4-

Try it online!
Prints 1 for match and 0 for no match.
Explanation
Grime is designed for matching two-dimensional patterns, which are constructed piece by piece from smaller patterns.
I define the optional top layer first, then the other layers by repeating a vertical stripe.
e`                                           Match entire input against pattern:
        /?                                   Optionally
  [ \,]+                                     a row of spaces and commas,
          /                                  below that
           (                       )         this pattern
                                    +        repeated horizontally
                                     {5-,4-  having size at least 5x4.
                                             The brace is closed implicitly.
                                             "This pattern" is a vertical stripe containing
            \,                               a comma,
              /                              below that
               [#@]^/[\-~]                   a sauce character on top of a noodle character
                                             (the ^/ is like / but with higher precedence)
                          /+                 repeated vertically,
                            /                below that
                                 /?          optionally
                             [#@]            a sauce character.

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


text:
Are we then yet?
I'm a time traveler, and I'm obsessed with the passage of time. I particularly love the moments when the clock hands pass 12, or when I get to flip to the next page of my calendar, or when everyone yells "Happy New Year!"
Please write for me a program to show me how far I am from the last such moment to the next, in the form of a progress bar. For example, if I tell it the time is 09:12, it should print this:
09:00 ####---------------- 10:00

If I tell it the month is May, 1982, it should print this:
1982-01 #######------------- 1983-01

Did I mention I'm a time traveler? I travel to anywhere from the first millisecond of 0 A.D. to the last millisecond of 9999 A.D., so the program needs to handle any date and time in that range.
Input

Input will be in one of the following formats:

YYYY-MM-DDThh:mm:ss.sss
YYYY-MM-DDThh:mm:ss
YYYY-MM-DDThh:mm
YYYY-MM-DDThh
YYYY-MM-DD
YYYY-MM

These are the only formats that need be handled. Each part will have exactly the number of digits shown, which means fractional seconds may have trailing zeroes (e.g. .120, never .12). The T is a literal letter "T" delimiting the date from the time. Hours are on a 24-hour clock.
Months and days are 1-based (more on this below).
Invalid and out-of-range inputs need not be handled.
At the programmer's discretion, input may have a single trailing newline.

Progress bar math
The program is concerned with the least- and second-least-significant units in the given input. For example, if the input has day-level precision (e.g. 2016-12-14), the progress bar will indicate what proportion of the days in the input month have elapsed versus what remains.
The progress bar will have 20 units (characters) and the proportion represented will be rounded to the nearest increment of 1⁄20. For example, given 2016-12-14T12:28, the progress bar will show Round(28⁄60 × 20) = 9 of 20 units "filled."
1-based months and days
Although the day of December 1 (for example) is 01 in 2016-12-01, for the purpose of calculation it is the 0th day of the month, because the truncated units imply the 0th millisecond of the 0th minute of the 0th hour of the day. In other words, 2016-12-01 is 0⁄31 of the way through December and 2016-12-02 is 1⁄31, and so on.
Likewise, 2016-01 is the 0th millisecond of the 0th day of January, so in calculations it is 0⁄12, which means 2016-12 is 11⁄12.
Yes, that means months and days will never completely fill the progress bar.
Differing month durations and leap years
Different months have different numbers of days and the output must reflect this—including leap years. The progress bar for February 6, 2017 will be different from the progress bar for February 6, 2016 (or January 6 of both years).
Miscellaneous

Time travelers use the proleptic Gregorian calendar. TL;DR: No special cases like missing days in 1752. Input will include dates in the year 0 A.D.
Time travelers ignore daylight savings.
The program is not required to account for leap seconds, but it may.

Output
The program (or function) must print (or return as a string) a horizontally-oriented 20-character progress bar that is "filled in" for time that has elapsed and "open" for time that remains. It must "fill in" from left to right.
The progress bar must have a label to its left showing the beginning of the period being counted and another to its right showing the beginning of the next period, in the same format as the input (but showing only two units of precision). For our example 2016-12-14 valid output would be:
12-01 #########----------- 01-01

Here are the valid label formats for each of the possible periods:

Months: YYYY-MM
Days: MM-DD
Hours: DDThh
Minutes: hh:mm
Seconds: mm:ss
Milliseconds: ss.sss

No additional units may be included in the labels, and none may be omitted.
Output notes

The progress bar's "filled in" units will be represented by a # character. "Open" units will be represented by -.
There must be exactly one space between the progress bar and each label.
Leading or trailing spaces and/or a single trailing newline are allowed.

Winning
This is code-golf. Shortest code in bytes wins. Standard rules apply. Standard loopholes forbidden.
Examples
Input                      Output
-----------------------    -------------------------------------
2016-12-12T12:17           12:00 ######-------------- 13:00
2016-12-12                 12-01 #######------------- 01-01
0000-01-01T00:00:00.000    00.000 -------------------- 01.000
0000-01-01T00:00           00:00 -------------------- 01:00
1899-12-31T23              31T00 ###################- 01T00
1899-12-31                 12-01 ###################- 01-01
1899-12                    1899-01 ##################-- 1900-01
1982-05-15T17:15           17:00 #####--------------- 18:00
1982-05-15T17              15T00 ##############------ 16T00
1982-05                    1982-01 #######------------- 1983-01
9999-12-31T23:59:59.999    59.000 #################### 00.000
9999-12                    9999-01 ##################-- 10000-01
2000-01-06                 01-01 ###----------------- 02-01
2000-02-06                 02-01 ###----------------- 03-01
2001-02-06                 02-01 ####---------------- 03-01
1742-09-10                 09-01 ######-------------- 10-01

Do we have to worry about leap seconds?

@Riley Good question. No.

I assume Daylight Savings is ignored, since there's no one standardized form?

@CAD97 Good question. You are correct. DST really complicates things for time travelers so we ignore it.

"1899-12-31T23" example is not valid according to the provided list of input formats, the same for "1982-05-15T17".
Please verify your test data.

@zeppelin Thanks. I've added the missing input format and corrected a couple test cases.

JavaScript, 282 bytes
(x,v=x.split(/\D/g),l=v.length-2,[a,b,c,d]=("10e5,01,-,12,01,-,"+new Date(v[0],v[1],0).getDate()+",00,T,24,00,:,60,00,:,60,000,.,1000").split`,`.slice(l*3,l*3+4),t=(v[l+1]-b)/d*20+.5|0,n=v[l],o=((n|0)+1)%a,r=l?('0'+o).slice(-2):o)=>n+c+b+' '+'#'.repeat(t)+'-'.repeat(20-t)+' '+r+c+b

Passes all the tests
(
x,
v=x.split(/\D/g),
l=v.length-2,
[a,b,c,d]=("10e5,01,-,12,01,-,"+new Date(v[0],v[1],0).getDate()+",00,T,24,00,:,60,00,:,60,000,.,1000").split`,`.slice(l*3,l*3+4),
t=(v[l+1]-b)/d*20+.5|0,
n=v[l],
o=((n|0)+1)%a,
r=l?('0'+o).slice(-2):o
) =>n+c+b+' '+'#'.repeat(t)+'-'.repeat(20-t)+' '+r+c+b

Test function prints nothing for pass, values for fail.
function test(value,expected){
    if (f(value)!=expected)
    {
        console.log(value);
        console.log(f(value));
        console.log(expected);
     }
}

The test cases:
test('2016-12-12T12:17','12:00 ######-------------- 13:00')                 ;
test('2016-12-12','12-01 #######------------- 01-01')                       ;
test('0000-01-01T00:00:00.000','00.000 -------------------- 01.000')        ;
test('0000-01-01T00:00','00:00 -------------------- 01:00')                 ;
test('1899-12-31T23','31T00 ###################- 01T00')                    ;
test('1899-12-31','12-01 ###################- 01-01')                       ;
test('1899-12','1899-01 ##################-- 1900-01')                      ;
test('1982-05-15T17:15','17:00 #####--------------- 18:00')                 ;
test('1982-05-15T17','15T00 ##############------ 16T00')                    ;
test('1982-05','1982-01 #######------------- 1983-01')                      ;
test('9999-12-31T23:59:59.999','59.000 #################### 00.000')        ;
test('9999-12','9999-01 ##################-- 10000-01')                     ;
test('2000-01-06','01-01 ###----------------- 02-01')                       ;
test('2000-02-06','02-01 ###----------------- 03-01')                       ;
test('2001-02-06','02-01 ####---------------- 03-01')                       ;
test('1742-09-10','09-01 ######-------------- 10-01')                       ;

I had to learn a new language to top this version... it is very concise!

Pyth, 213 bytes
My first code in pyth!  Behold:
+%h=N:[d"%.4d"\-=Z"%.2d"\-Z\TZ\:Z\:Z\."%.3d")-*2lKr:w"[-T:.]"d7 3*2lKJ@K_2+@N1+%eN=b<lK4+d+*\#=Gs+*20c-eKb@=H[0^9T12?q2=k@K1+28+q0%=YhK4-q0%Y400q0%Y100+30%+k/k8 2 24 60 60 999)lK.5+*\--20G+d+%hN%+J1@H-lK1+@N1%eNb

My pyth code is closely based off of my previous python answer.  Here is the ungolfed version with comments:
"K is the input, as a list of numbers"
Kr:w"[-T:.]"d7
"Y=year"
=YhK
"k=month"
=k@K1
"H = a list of denominators"
=H[0 ^9T 12 ?q2k+28+q0%Y4-q0%Y400q0%Y100 +30%+k/k8 2 24 60 60 999)
"J is the second-to-last number of the input"
J@K_2
"b is the +1 starting point for months and days"
=b<lK4
"G is the number of hashtags in the statusbar"
=Gs+*20c-eKb@HlK.5
"N is the formatted string"
=N:[d"%.4d"\-=Z"%.2d"\-Z\TZ\:Z\:Z\."%.3d")-*2lK3 *2lK
+%hNJ+@N1+%eNb+d+*\#G+*\--20G+d+%hN%+J1@H-lK1+@N1%eNb

Testing multiple values is easily accomplished by making the code loop, and adding a newline print to the end:
Wp+%h=N:[d"%.4d"\-=Z"%.2d"\-Z\TZ\:Z\:Z\."%.3d")-*2lKr:w"[-T:.]"d7 3*2lKJ@K_2+@N1+%eN=b<lK4+d+*\#=Gs+*20c-eKb@=H[0^9T12?q2=k@K1+28+q0%=YhK4-q0%Y400q0%Y100+30%+k/k8 2 24 60 60 999)lK.5+*\--20G+d+%hN%+J1@H-lK1+@N1+%eNb"\n"

Then I ran cat testinput | pyth code.pyth > output and diff output testoutput  Or try it online.

Python 2, 371 bytes
This challenge was surprisingly difficult!  It seemed like I was going to be just under 300 until I worked out the output string formatting.
The kind of cool part is that my answer does not use any date package:
import re
s=raw_input()
S=[int(i)for i in re.sub('[-T:.]',' ',s).split()]
l=len(S)
y,m=S[:2]
d=[0,20<<9,12,28+(y%4==0!=y%100)+(y%400==0)if m==2else 30+(m+m/8)%2,24,60,60,999]
a,n=S[-2:]
b=1-(1if l>3else 0)
h=int(20.*(n-b)/d[l]+.5)
x,y,z='- %.4d - %.2d - %.2d T %.2d : %.2d : %.2d . %.3d'.split()[l*2-3:l*2]
print x%a+y+z%b+' '+'#'*h+'-'*(20-h)+' '+x%((a+1)%d[l-1])+y+z%b

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


text:
Find the sortable years
The year 2013 had an interesting property: the digits are consecutive when sorted (0123). Let's call this type of number a sortable number: a non-negative integer whose base-10 digits are consecutive after sorting. Unfortunately, this won't happen again until 2031, and after that, not until 2103. Your challenge is to write a program or function that, when given a non-negative integer through any standard method, outputs or returns the next sortable number.
Rules

Input and output must be in base 10.
Output may be in any reasonable format (number literal, string literal, single-item array, ...).
Your code must produce the proper output within 1 minute for all inputs up to 98764.

Test cases
    0 -> 1
    1 -> 2
    9 -> 10
   10 -> 12
   11 -> 12
   99 -> 102
  233 -> 234
  234 -> 243
  243 -> 312
 2016 -> 2031
 2031 -> 2103
 2103 -> 2130
 2130 -> 2134
 2134 -> 2143
 9876 -> 10234
98764 -> 98765

The sortable numbers form A215014. A list of all entries up to 98765 can be found here.
Scoring
This is code-golf, so the shortest code in bytes wins.

What do you mean by work? Is it OK if it takes a really long time?

@Dennis It must finish with 1 minute for all inputs up to 98764. This has been clarified in the post.

@ETHproductions Does it have to support larger inputs at all?

@MartinEnder No, although I expect most (if not all) solutions will. Should the requirement be higher?

@ETHproductions I don't think so, I just wanted to make sure.

Can we return a singleton array, e.g., [98765]?

@Dennis I'll say yes, as that's a pretty clear format.

Your code must produce the proper output within 1 minute for all inputs up to 98764. What if our language literally can't do this, because it is a tarpit and the interpreter has to perform a lot of relatively heavy operations?

@DestructibleWatermelon I don't really know how to allow ridiculously slow languages. What is the longest the language is question takes for an input in that range?

I haven't actually made an answer that takes too long, but Turtlèd can take a large amount of time to increment a number, as it may have to instantiate a bunch of strings to do so, and the rest of the code would not be unreasonably expected to take a long time for its checking of included chars. maybe this should be put to a meta post?

Any base is base 10

May I assume that the input will always be less than 987654321?

Python 2, 61 bytes
f=lambda n:-~n*(`sorted(`n+1`)`[2::5]in'0123456789')or f(n+1)

Try it online!

I want '0123456789' to be something like 1./81, but it doesn't quite work.

Best you're getting is 1./81.0000001 which still wouldn't properly work and is longer

@AlfieGoodacre You could do better with 1./81-1e-10 but it's still 10 bytes and you'd still have to truncate it.

Jelly, 11 10 9 bytes
⁵ḶwṢ
‘Ç1#

Returns a singleton array. Try it online!
How it works
‘Ç1#  Main link. Argument: n

‘     Increment; yield n+1.
 Ç1#  Apply the helper link to k = n+1, n+2, n+3, ... until one of them maps to a
      truthy value. Yield a singleton array containing that value of k.

⁵ḶwṢ  Helper link. Argument: k

⁵     Set the return value to 10.
 Ḷ    Unlength; yield [0, ..., 9].
   Ṣ  Sort; yield the sorted array of k's decimal digits.
  w   Window-index; yield the 1-based index(truthy) of the digit array in
      [0, ..., 9], 0 (falsy) if not found.

MATL, 8 bytes
`QtVSdqa

Try it online! Or verify all test cases.
Explanation
`     % Do...while
  Q   %   Add 1. Takes input (implicit) in the first iteration
  t   %   Duplicate
  V   %   Convert to string. This gives an array of chars (same as a string)
      %   representing the digits
  S   %   Sort
  d   %   Consecutive differences between the chars (automatically converted
      %   to ASCII codes)
  q   %   Subtract 1. This gives an array where consecutive differences equal
      %   to 1 are converted to 0, and the rest give a nonzero result
  a   %   True if any value is nonzero. This is the loop condition: if true
      %   (which means at least one consecutive difference was not 1), go on
      %   with the next iteration. Else exit loop
      % End do...while (implicit)
      % Display (implicit)

JavaScript (ES6), 64 54 bytes
Saved a massive 10 bytes, thanks to Neil
f=n=>[...++n+''].sort().some((v,i,a)=>v-i-a[0])?f(n):n

Test cases

f=n=>[...++n+''].sort().some((v,i,a)=>v-i-a[0])?f(n):n

console.log(f(0));      // -> 1
console.log(f(1));      // -> 2
console.log(f(9));      // -> 10
console.log(f(10));     // -> 12
console.log(f(11));     // -> 12
console.log(f(99));     // -> 102
console.log(f(233));    // -> 234
console.log(f(234));    // -> 243
console.log(f(243));    // -> 312
console.log(f(2016));   // -> 2031
console.log(f(2031));   // -> 2103
console.log(f(2103));   // -> 2130
console.log(f(2130));   // -> 2134
console.log(f(2134));   // -> 2143
console.log(f(9876));   // -> 10234
console.log(f(98764));  // -> 98765

You can save 2 bytes from your original answer by noting that the third parameter to the map callback is the array itself, but you can go on to do much better: f=n=>[...++n+''].sort().some((v,i,a)=>v-i-a[0])?f(n):n

Pyth - 11 10 bytes
f}S`TjkU;h

Test Suite

PowerShell v2+, 71 68 67 bytes
param($n)do{$n++}until(-join(0..9)-match-join([char[]]"$n"|sort))$n

Try it online!
An iterative solution that runs pretty much instantaneously on my machine.
PS C:\Tools\Scripts\golfing> measure-command {.\find-the-sortable-years.ps1 98764} | fl totalseconds

TotalSeconds : 0.0487127

Yes, that's a do/until loop in a code-golf. Sorry, not sorry. Basically we loop upwards from our input $n until $n|sorted regex -matches against 0123456789. Then we place $n on the pipeline, and output is implicit.
Saved a byte by realizing that -join(0..9) is one byte shorter than the literal string 0123456789.

Mathematica, 63 bytes
#+1//.x_/;!Differences@Sort@IntegerDigits@x~MatchQ~{1...}:>x+1&

Replaces #+1 with the next value as long as Differences@Sort@IntegerDigits@x~MatchQ~{1...} is false, which is the condition that the current value is sortable.
Here's another fun idea, that unfortunately ended up being way too long:
FirstCase[FromDigits/@Union@@Permutations/@Join@@Array[Range,{9,10},0],x_/;x>#]&

In this one, I'm generating all the sortable years first and then I select the first one that is greater than the input.
Some more ideas that didn't turn out to be shorter than the first attempt:
#+1//.x_/;Array[Range,{9,10},0]~FreeQ~Sort@IntegerDigits@x:>x+1&
#+1//.x_/;Subsequences@Range[0,9]~FreeQ~Sort@IntegerDigits@x:>x+1&
#+1//.x_/;0~Range~9~FreeQ~{___,##&@@Sort@IntegerDigits@x,___}:>x+1&

PHP, 105 103 89 bytes
New 89 bytes version thanks to Titus:
for(;!$p;){$t=str_split($n=++$argv[1]);sort($t);$p=strstr('0123456789',join($t));}echo$n;

Usage:
php -r "for(;!$p;){$t=str_split($n=++$argv[1]);sort($t);$p=strstr('0123456789',join($t));}echo$n;" 9000

Previous 103 bytes version thanks to Xanderhall:
<?for($p=0;!$p;){$t=str_split($n=++$_GET[n]);sort($t);$p=strstr('0123456789',implode($t));}echo "$n\n";

Previous 105 bytes version:
<?for($n=$_GET[n]+1;;$n++){$t=str_split($n);sort($t);if(strstr('0123456789',implode($t))){echo$n;exit;}}

Usage: sortable-years.php?n=9000 outputs 9678.
Ungolfed version with test cases:

$test = array(0,1,9,10,11,99,233,234,243,2016,2031,2103,2130,2134,9876,98764);

foreach ($test as $argv[1]) {
    for(;!$p;){
        $t=str_split($n=++$argv[1]);
        sort($t);
        $p=strstr('0123456789',join($t));
    }
    echo "$n\n"; // add newline for testing
    $p=false; // reset $p for testing
}

Output:
1
2
10
12
12
102
234
243
312
2031
2103
2130
2134
2143
10234
98765

Test online! (New 89 bytes version)
Test online! (Previous 103 bytes version)
Test online! (Previous 105 bytes version)
Execution time maybe <= 1 second for all the test cases.

Made some improvements

@Xanderhall thanks for your improvements. Actually I was trying to find a way to take that break (exit on the golfed version) away, you found it! Great.

The link I posted was just code to give you an idea of how to improve it, it's not fully golfed XD

$i=0 is unnecessary (-4). join is an alias for implode (-3). echo$n is enough output (-5). $argv[1] instead of $_GET[n] allows -r which allows you to omit the <? tag (-2).

@Titus thanks a lot for your great golfing tips, I still have so much to learn about it, and I also have to pay more attention on some details too that I miss... I didn't know yet about join as alias of implode! About the php -r parameter, I used in the past but lately I'm not using it because (I don't know why) sometimes I can't make it work properly in some cases.

C#, 153 130 101 bytes (122 99 83 excluding namespace declarations)
using System.Linq;n=>{while(!"0123456789".Contains(string.Concat((++n+"").OrderBy(x=>x))));return n;}

-23 bytes thanks to pinkfloydx33
another -29 thanks to Link Ng (I really should have known I don't need to convert it into an array)
Damn conversions.
(Added bonus this is surprisingly fast)

You don't need to string, use $"{n}".ToCharArray() or (""+n).ToCharArray() and you don't need the brackets after the while: while(!s.Contains...)n++; or better yet combine them and leave an empty loop body: while(!s.Contains(.....$"{n++}".ToCharArray()....);return n;  declare s with var s="... " or remove it entirely: while(!"0123456789".Contains(...

I think you can also remove the first n++ and instead combine it with the above and do $"{++n}".ToCharArray()

@pinkfloydx33 I added a majority of the changes you suggested, if not all!

Remove use System; and use string instead of String for 11 bytes. Use string.Concat instead of string.Join and keep only the 2nd parameter for 1 byte. Change ""+ ++n to ++n+"" for 1 byte. Left to you as exercise: 14 more bytes can be removed.

@LinkNg changes have been made - I feel like a fool for the array xD

Perl 6, 49 bytes
{first {$/eqv($/=.comb.sort).minmax.list},$_^..*}

Explanation
{

  first

  {

    $/             # sorted list from later

    eqv            # is it equivalent

    (

      $/           # store in match variable ( doesn't need to be declared )
      =
      .comb.sort   # sorted list of digits from currently tested value

    ).minmax       # the Range of digits
            .list  # flattened to a list
  },

  $_  ^..  *       # Range starting just after input

}

Test:
# give it a lexical name for clarity
my &code = {first {$/eqv($/=.comb.sort).minmax.list},$_^..*}

my @all = +«'sortable.txt'.IO.lines;

my @gen = code(-1), &code ... ( * >= 98765 );

say @all eqv @gen; # True

say now - INIT now; # 16.3602371

05AB1E, 10 9 bytes
-1 thanks to Emigna.
[>D{žhså#

Try it online!
New description coming when I have time.

[>D{žhså# for 9 bytes.

Befunge, 117 bytes
&>1+0v
9`#v_>:9+0\4p1+:
1:$<v
0g1+>00p:55+%9+1\4p55+/:!#v_0
v+*g09:<".........." 9p09 <
>:00g-v^<
-9:p09_v|
$v@._<$<>

Try it online!
The way we test if a year is sorted is by creating an "array" (written into the string literal on line five) and for every digit in the year, we set that index into the array to 1. Once all the digits have been processed, we count how many 1s there are in sequence, and if that count equals the year length we can assume the year is sorted.
Detailed Explanation
&>1+                              Read the year and increment it.

    0v                            The "array" is initialized with zeros prior
9`#v_>:9+0\4p1+:                     to processing each year.

1:$<v                             For every digit, set the corresponding array index
0g1+>00p:55+%9+1\4p55+/:!#v_0       to one, and increment the year length counter.

                      p09 <       Initialise the sequence counter to zero.
                     9            Push a marker onto the stack.
        ".........."              Push the values from the array onto the stack.

v+*g09:<                          Increment the sequence counter for every 1 in the
>:00g-v^<                           array and reset it on every 0. Break if it equals
-9:p09_v|                           the year length or we encounter the end marker.

  @._<$<                          If we have a match, clear the stack and output the year.
$v      >                         If we've reached the marker, drop it try the next year.

Python 2, 118 117 114 108 Bytes
x,s=input()+1,sorted
while[j for i,j in enumerate(s(str(x))[1:])if int(s(str(x))[i])+1!=int(j)]:x+=1
print x

EDIT:
-1 Byte thanks to @Gábor Fekete
-6 Bytes thanks to @Zachary T

You can save 1 byte by aliasing the sorted function.

Can't you save some bytes by converting to python 2?

Yes I could, thanks, I hadn't thought of that.

Ruby, 51 bytes
->n{n+=1 until'0123456789'[n.to_s.chars.sort*''];n}

Python 2, 68 bytes
n=input()+1
while''.join(sorted(`n`))not in'0123456789':n+=1
print n

Well beaten by @Dennis but just posted as an alternative method anyway.

C#, 127 bytes
using System.Linq;n=>{char[]s;while((s=(++n+"").OrderBy(x=>x).ToArray()).Select((x,i)=>i>0&&x-s[i-1]!=1).Any(x=>x));return n;};

Beat the current C# submission by 3 bytes :p Beaten back already
I know this answer will be beaten back easily...
repl.it demo
Ungolfed
n=>
{
    char[] s;
    while((
        // Store char array in variable to be referenced in Select()
        // Increment n and cast to string
        s=(++n+"")
            // Sort ascending, to array
            .OrderBy(x=>x)
            .ToArray())
        // Convert char to true if it's not at position 0,
        // and it is not 1 greater than the previous char
        .Select((x,i)=>i>0&&x-s[i-1]!=1)
        // All false: n is sortable
        // Any true: n is not sortable
        .Any(x=>x))
    // while loop body is empty
    ;
    return n;
};

PHP, 90 89 88 bytes
a completely different approach:
while(array_unique($a=str_split($n=++$argv[1]))!=$a|max($a)-min($a)-count($a)+1);echo$n;

Run with -r.
breakdown
while(
    array_unique(           // 3. unique values
        $a=str_split(       // 2. split to digits
            $n=++$argv[1]   // 1. increase number
        )
    )
    !=$a                    // 4. repeat while unique digits differ from original digits
    |                       // or
        max($a)-min($a)     // digit range
        -count($a)+1        // differs from count-1
    );
echo$n;                 // print result

Clojure, 104 96 91 bytes
Long method names don't make this that short... At least map-indexed and - get main calculations done in a neat way.
Edit 1: Neat, I forgot also = can take multiple arguments so I don't need to check if count of distinct values is 1.
Edit 2: No need to run (sort(seq(str %))), (sort(str %)) works equally well.
(fn[i](first(filter #(apply =(map-indexed -(map int(sort(str %)))))(rest(iterate inc i)))))

Ungolfed:
(defn f [i]
  (let [is-sorted? #(= 1 (->> % str sort (map int) (map-indexed -) set count))]
    (->> i (iterate inc) rest (filter is-sorted?) first)))

R, 87 bytes
f=function(x)`if`(all(diff(sort(as.double(el(strsplit(c(x+1,""),"")))))==1),x+1,f(x+1))

As usual when it comes to splitting numbers into digits, R does not have a native way of doing this. Consequently we have to coerce the input into a character, split into a character vector and subsequently convert back to any numeric type.
Try it online


text:
Significant Whitespace: Cops
For the purpose of this challenge, we'll define whitespace as only linefeeds (0x0A) and spaces (0x20). Note that most languages and regex flavours consider many other characters as whitespace as well, both inside and outside the ASCII range so you might not be able to make use of the corresponding built-ins.
The Cops' Challenge
You should write a program or function in a language of your choice, which takes a string, consisting of ASCII (except NUL) characters, as input and outputs it with all whitespace removed. For example if you received the following input:
H e l l o,
 W o r l  d!

You should output
Hello,World!

Your submission will then be your source code with all whitespace removed (the same process as passing your solution as input to itself, although your solution may also contain characters outside the ASCII range). Your goal is to make it as hard as possible to figure out where whitespace needs to be inserted to recover a valid solution in your language of choice. Note that robbers may insert fewer whitespace than you removed, but not more. Also remember that robbers don't have to match your exact code, they just have to find any valid solution.
Your answer should contain the following:

The language (and version if necessary) in which you wrote your solution.
The byte count of your solution before removing whitespace.
Your solution with whitespace removed.

Your solution may be either a program or function, but not a snippet and you must not assume a REPL environment. You may take input via STDIN, command-line argument or function argument and output via STDOUT, function return value or function (out) parameter.
In the interest of fairness, there must be a freely available interpreter or compiler for your chosen language.
You must not use built-ins for hashing, encryption or random number generation (even if you seed the random number generator to a fixed value). Your solution must be able to process any string of 100 characters or less in under 10 seconds on a reasonable desktop machine.
If your answer has not been cracked within 7 days (168 hours), you may reveal your own solution at which point your answer is considered safe. As long as you don't reveal your solution, it may still be cracked by robbers, even if the 7 days have already passed. The shortest safe answer wins (measured before removing whitespace).
If your answer does get cracked, please indicate this in the header of your answer, along with a link to the corresponding robber's answer.
Go here for the robbers' part.
Uncracked Submissions

Related. (Inspiration, in fact.)

Seems like Whitespace would break this challenge...

@SeeOneRhino Why? The robber just has to solve the problem in Whitespace, not using more bytes than the cop. Unless a cop finds a crazily well-golfed Whitespace answer that no one can match, Whitespace answers are generally the most vulnerable in this challenge.

I guess I misunderstood. I thought whitespace would do something strange...

@SeeOneRhino Also, tabs don't count as whitespace, so they wouldn't be removed.

No hexagony submissions this time, I guess

If my language accepts input one character at a time (and outputs one character at a time as well), can I separate my input/output by lines?

@GabrielBenamy how would you represent linefeeds in that case? I don't see why reading input character by character would make the task a problem?

When COW reads ASCII input, it reads the first character, stores its code point in memory, and then continues reading and discarding characters until it reaches a \n.  So to represent a newline in your input, simply have two newlines in a row.

@GabrielBenamy if that's the only way to represent an arbitrary string, I'm fine with it, but please state this in your answer.

The snippet doesn't seem to do anything for me on Firefox, though it throws a "400 (Bad Request)" error on Chrome.

It strikes me that a winning solution in PERL would be using acme::Bleach; followed by a bunch of whitespace, well golfed.  Gives the robbers literally no information to go from!  Anyone feel like coding that?

Haskell, 100 bytes, cracked by nimi
main=interact$iddoidlinesidwordsdoidoidoid=doiddoid<-dooiidoid<-dooiddoiddodoid

This is a full program and a dadaistic poem.

Code with withspace (Try it online!)
main=interact$id doid lines id words
doid oi d o id=do
 iddoid<-do oi id
 oid<-do o iddoid
 do d oid

Still looking quite poetic, if you ask me.
De-obfuscated
main = interact f
f s = do
 l <- lines s
 w <- words l
 id w

Explanation
The do-notation is only syntactic sugar, so f can equivalently be written as
f s = lines s >>= words >>= id

For lists the >>=-operator is defined as concatMap, so f becomes
f = concat . map id . concat . map words . lines

So given an input "a b\nc", lines splits the input at newlines ["a b","c"], words splits each line at white space yielding [["a","b"],["c"]] (as I realised only now this includes newlines, so lines actually isn't needed). Concatenating once gives ["a","b","c"], id is the identity function and as such has no effect and the final concatenation yields the string "abc".

Do I need to say that I like dadaistic poems?

my guess

@nimi yes, well done.

C, 475 bytes, cracked by Riley
Certain parts of C make it really really easy to see where whitespace should go.  The c pre-processor, however, does not.  So this code is sort of in two halves: up to line 17 (236 characters with whitespace) the code is virtually unobfuscated, and after that (239 characters with whitespace), good luck!
Not gonna win this competition by a long shot, but I wanted to see what could be done with the c pre-processor.
#include<unistd.h>#defineachar#defineb*#definecwrite#definedstdin#defineestdout#definefread#defineg(#defineh)#defineiwhile#definejif#definek0#definel&#definem,#definen=#defineo;#definep1#definegpmlmlh#defineabo#definemldmp#definejgdoabo#definelbabod#definegfhaboc#definejgmben#definepmlfg#definegpmlbintmain(){ajgajgmljgigpmlkmlgpmlhjgd!=''&&gpm!='\n'gfgpmlgpmlo}

Compiles (with warnings, if you enable them) with gcc -std=c89 -ansi and works like cat file | ./a.out

This was cracked much faster than I thought, congrats!  My strategy was to use #defines to remove obvious token boundaries (like ';') and then use more #defines to make it REALLY unintuitive how they were shuffled around.
This, by the way, is what the code looks like after only the obvious whitespace has been added:
#include <unistd.h>
#define a char
#define b *
#define c write
#define d stdin
#define e stdout
#define f read
#define g (
#define h )
#define i while
#define j if
#define k 0
#define l &
#define m ,
#define n =
#define o ;
#define p 1
// thus begins the obfuscation
#define gpmlmlh
#define abo
#define mldmp
#define jgdoabo
#define lbabod
#define gfhaboc
#define jgmben
#define pmlfg
#define gpmlb
int main(){
    ajgajgmljgigpmlkmlgpmlhjgd!=''&&gpm!='\n'gfgpmlgpmlo
}

Welcome to PPCG! :)

Cracked This one way really fun.

Octave, 69 bytes, SAFE!
@(U)eval([85329685312682956148388531268295156241''])

Input format:
Newlines can't be inputted directly in the command prompt. Create the string by concatenation like this:
str = ['This is ',10,'a',10,'string']
str = This is
a
string

Call the function like this (add whitespace):
f=@(U)eval([85329685312682956148388531268295156241''])
f(['This is ',10,'a',10,'string'])

Original code:
You only needed 66 bytes for this to work, but I wrote 69 in the header in order to not give away too much information.
The original code looks like this:
@(U)eval([853 296 853 126 829 561 48 38 853 126 829 51 562 41 ''])

Explanation:
@(U)eval(.....)    % Anonymous function taking U as the input variable

U is code point 85 in the ASCII table, so it would appear like the first space should be after 85. Wrong!
If we insert the space after 853 instead, we should get character number 853, right..? Using char to check if that's a recognizable character:
char(853)
warning: range error for conversion to character value

However, we don't use char in the code, we use the shorter version where we concatenate the numbers with an empty string [853 '']. Instead of giving an out of range error, the shorter version simply takes the numbers modulus 256.
It just so happen to be that 85+3*256 = 853. While char(853) gives a warning, [853,''] returns U.
The obvious way to do this task in Octave is:
@(U)U(U~=10&U~=32)

We know that there has to be an opening parentheses (code point 40) after the first U. 29 obviously doesn't fit so we shift the space one further right and get 296. mod(296,256) = 40. Bingo!
Continue like this and end up with the sequence:
[853 296 853 126 829 561 48 38 853 126 829 51 562 41 '']
ans = U(U~=10&U~=32)

Finally, we use eval to turn the string into code.

+1 for explaining input format in 2 lines while it took me 10 :-D

Well, still no idea, except that now I recognize letter U among that bunch of numbers :-)

Very good trick! It's crazy that Octave does that with character codes. I had no idea about it. But then, what can you expect when the official doc says that Octave supports Unicode by accident... :-P

Befunge-93, 58 bytes, Safe!
_vv$v<~:!`:<#^0*@-:0*5|845\+`-v0,<#-^<

Try it online!
Original Program
_vv
 $ v<
 ~:!`
 :<#^0
*  @
-:0
*5 |
8
45
\+`
-
v0,<
#-
^<

Try it online!
The trick to this was that the path of execution was more vertical than horizontal, then various spaces were inserted at random in the code to further shuffle the vertical paths. Once the line breaks and whitespace were finally removed, there was hopefully then very little to indicate how the operations related to each other.
In case that wasn't difficult enough, I also threw in a bit of interleaving, so a number of operations ended up being executed by different code paths flowing perpendicular to each other. The idea being that if you thought you'd found the correct position for a particular command, you wouldn't realise you might need to use it again later in the code.
Not sure if it was worth all that effort trying to make things complicated, or people didn't even bother trying to solve it. :)
Code Explanation
_      Since an empty stack is treated as zero, this initially just branches right.
v      The program flow is then directed downwards.
$      And this drop command initially does nothing because the stack is still empty.
~      A character is read from stdin.
::     Two duplicates are created.
55+-   We subtract 10 from the first copy (the 0- is just a nop to confuse things).
\48*-  And subtract 32 from the second copy.
*      The product of those two will be zero if the character is a newline or space.
_      So if we got whitespace, our branch goes right again repeating the loop.

v      If not, we go left, wrapping around till we hit the down arrow in column 3.
:<:    Again we make two duplicates of the character.
0`!|   One copy is used to compare if it's not greater than zero.
@      If it's not (i.e. it's the EOF), the branch goes up and we terminate.
<      Otherwise we go down and to the left.
,      Output the second copy of the character, leaving one remaining on the stack.
0      Push a zero to force the next branch right.
v      Redirect the flow down, wrapping to the top again.
_      Back at our initial branch, the zero we pushed forces us right.
v      Again the program flow is directed downwards.
$      And the drop command gets rid of the last duplicate character.
~      So now we're back reading the next character and the loop repeats.

JavaScript ES6, 199 bytes, cracked by SLuck49
A rather bulky entry with 33 bytes of whitespace to add.
s=>eval(atob`ISYgJiAtOkI8Qk97BRBeaxZFShoUZSsiOGkMenNy`.replace(/./g,(c,i)=>String.fromCharCode(c.charCodeAt()^(k+="SecretCode".split(/\w/)[i%11].length)),k=0)).join``

Nice one.. I guess we need to add the proper amount of whitespace to "SecretCode" in order to xor the encrypted string and get the proper source~

@PatrickRoberts Yes, exactly.

I've already got an automated script testing all possible combinations, it's just a matter of time... wrings hands together, knowing his evil plan is working

Phew... this is taking longer than I thought. I'm thinking of writing a code golf challenge to calculate the number of permutations possible, given an array of length N and a sum S that the elements must sum to. Right now I'm at [ 10, 0, 0, 0, 0, 9, 8, 1, 5, 0, 0 ] for the gap sequence and my iteration function for the array is (a)=>{for(var x=0;!a[x];x++);if(a.length-x>1){a[0]=a[x]-1;a[x]=(x==0?a[x]:0);a[x+1]++;}else{a[0]=a[x]+1;a[x]=0;i=0}}. I started at [ 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ].

I just reached [ 32, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]... I might spawn another program that iterates backwards.

Obligatory movie reference

I'm gonna be so mad if it turns out there's supposed to be spaces in the regexp...

@PatrickRoberts I did the math, there's 1,917,334,783 combinations assuming all 33 spaces are part of the key

@SLuck49 thanks! That's not too bad when you think about it. My very rough estimate was magnitudes larger than that. You've given me hope!

Just reached [ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ] on my forward iteration. My backward iteration is around... [ 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 28 ], but its iteration is overlapping some with the forward iteration, so only Arnauld knows which one will get there first!

Cracked. Sorry @PatrickRoberts I beat you to it, I've been running mine all day and exhausted like 95% of the search space... that was nuts.

@SLuck49 darn.. I was probably only about another hour behind.

@SLuck49 okay I was wrong... my program finished probably about 20 minutes ago. Nice job.

><>, 40 bytes, Cracked by Teal pelican
v</1?o-=="?;">^

I used fishlanguage.com by the way, just in case there are differences between interpreters.

Cracked

C#6, 201 bytes, Cracked by Link Ng
usingSystem.Linq;_=>string./**/#iftrueJoin(/*"*//*/""/**//*/"*/",#elseConcat(//*/,#endiffrommin""letp=$@"{@""[1]}"fromiin(_.Replace(p,@""))where!new[]{p[0]^32^10}.Contains(i)select@i);

184 bytes collapsed, leaving you 17 bytes of whitespace.
Cracked solution using the Concat whereas my intended solution used the Join, here's the intended solution:
_=>string./**/
#if true
Join(/*"* //*/""/**//*/"* /",#elseConcat(//*/,
#endif
from m in" "let p=$@"{@"  "[1]}"from i in(_.Replace(p,@"
"))where!new[]{p[0]^32^10}.Contains(i)select@i);

This needs c# 6+ to work, can you add that in?

This has been cracked by @Link Ng: http://codegolf.stackexchange.com/a/103233/38550

MATL, 22 bytes. Cracked and cracked.
This is a program that takes input through STDIN and produces the output through STDOUT.
Code without spaces or newlines:
t'@*'dm1e5%Mdw%Y(

The input format is a little awkward because of how MATL takes string input. Strings with newlines cannot be entered directly through STDIN, because each input has to be a single line (newline marks the end of input). So the format is as follows:

A string is enclosed with single quotes. If the string content includes single quotes, they are escaped by duplicating. Example: 'I''m a string'
To enter a string with newlines one needs to split the string at newlines and concatenate everything (by means of square brackets), including numbers as ASCII codes. For example, consider the string formed by my first and last names with a newline in between. It would be entered as ['Luis' 10 'Mendo'].
This allows entering any other (possibly non-printable) ASCII codes. So the string in item 1 above could be alternatively entered as ['I' 39 'm ' 97 32 'string']. Check it here.
The only condition is that at least one of the parts within the brackets is a string. That forces any numbers to be interpreted as ASCII codes when concatenating.

Sorry about the awkward Good luck using this format!
Original solution
t' @ *'dm1e 5%
Mdw%Y
(

Each % is a comment symbol, and so the rest of the line is ignored.
Spaces do nothing, but serve as separators. For example, 1e5, without the space, would be interpreted as the number 100000.
t takes the input and duplicates it.
' @ *' pushes that string, and d computes its consecutive differences, which gives [32 -32 10] (the -32 is useless).
m gives a logical row array indicating which characters are 32 or 10 (or -32).
1 followed by e reshapes as a row. This is no-op here.
5 followed by M pushes 1 again (last input to the most recent multiple-input function, which is e).
d computes consecutive differentes of 1, and so gives [] (empty array).
w swaps, and finally ( assigns [] to whitespace characters, i.e. removes them.

You're lying! No way this works! (+1)...

cracked?

Crap... I didn't notice it was already cracked... Well, double cracked.

Nice work both of you! :-) Not exactly my intented solution but it works perfectly

Java, 3241 + 28 Bytes for a big Integer import
This entry is solely to prove the possibility of a purely cryptographically secure entry. I believe this is within the rules, but if it is against the spirit, please let me know and I will delete out of fairness. I will leave this "unsafe" indefinitely until such a time when (and if) a crack gets found. This is a monstrosity and could surely be further optimized, but here it is.
interfacer{staticvoidmain(String[]A){Strings=",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",q=",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",a="",b="";for(Stringt:s.split(",")){a+=t.length();}for(Stringt:q.split(",")){b+=t.length();}if((newBigInteger(a).multiply(newBigInteger(b)).toString()).equals("3649760552772806991406184564114682549877113954361462782925976763675666255653486225665808494957477900238166874367635068317805381406282572366371821972593595701388544127398102379288357379612333197280663769935384647844344358594407966485992727383589962048236726744715096711312156760311643104858212670342667229690568585229658813910569607411855770280546861422837629553847973043531578541545436967345783407835402474562087790816775240815912495599135241317")){System.out.println(A[0].replaceAll("","").replaceAll("\n",""));}}}

Out of fairness to robbers, here is it with all the  "obvious" whitespace added.
interface r {

    static void main(String[] A) {
        String s = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", q = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", a = "", b = "";
        for (String t : s.split(",")) {
            a += t.length();
        }
        for (String t : q.split(",")) {
            b += t.length();
        }
        if ((new BigInteger(a).multiply(new BigInteger(b)).toString()).equals("3649760552772806991406184564114682549877113954361462782925976763675666255653486225665808494957477900238166874367635068317805381406282572366371821972593595701388544127398102379288357379612333197280663769935384647844344358594407966485992727383589962048236726744715096711312156760311643104858212670342667229690568585229658813910569607411855770280546861422837629553847973043531578541545436967345783407835402474562087790816775240815912495599135241317")) {
            System.out.println(A[0].replaceAll("", "").replaceAll("\n", ""));
        }
    }
}

Good luck, I would love to see this cracked. In fact I will even institute an unlimited bounty on this. If at any point you do crack this, you will be awarded 500 rep infinite accolade on stack exchange (as well as likely a wonderful mathetatical paper).

There are more }s than {s. Are you sure that was intended?

@KritixiLithos sorry, while I was developing this, I had it inside of another nested class

Your solution and mine will likely walk down the ages uncracked.

To the downvoter, is there something illegitimate about this submision?

There is actually a trivial solution for this (that does not involve factoring an RSA-440 number equivalent), unfortunately it requires an extra ~10,000 bytes...

@SLuck49 can you comment it to me?

@SLuck49 wow! I just realized what you were looking at! I almost lost 500 reputation.

Yeah, for anyone curious basically you use one space to make b=1, and you make a=364976... by using 36 spaces, 49 spaces, 76 spaces, etc... unfortunately I couldn't find a way to shorten that. Just goes to show it's usually far easier to attack a crypto-implementation than a crypto-algorithm.

When I just try to compile the code with the 'obvious whitespace', javac is complaining about the "static" at the interface. What am I doing wrong there? (Without the 'static', it compiles.)

@ProgramFOX I'm not sure why I had added that "static" in. I have now removed it.

Ruby, 86 bytes + 1 flag = 87 (cracked by Dom Hastings)
Requires command-line flag -p.
eval"(T$}{(!//;:678?32.&&)".gsub(/|(.)/){$1&&$&.ord.^($'.count('')).chr}

The code is actually valid in this form, it's just a no-op.

This is awesome, I love it! So mean...

Cracked!

RProgN, 15 Bytes Cracked!
''`R""`R

You can toy with the code here. A relatively simple solution, hopefully the annoying nature of how RProgN handles strings will leave this uncracked.
Original Program
' ' ` R
"
" ` R

Explination
Firstly, the input is implicitly pushed to the stack. Stack: <INPUT>
Then, we use ' ' to push a space to the stack. Stack: <INPUT> " "
the ` actually tries to push a string represented by `(WORD) but because there's whitespace after it, it just pushes an empty string. Stack: <INPUT> " " ""
The R here is sugar for the Replace command. Stack: <INPUTWITHOUTSPACES>
Next, the "NEWLINE" pushes a string containing a newline, which is nice because RProgN doesn't use escapes, it just straight up lets you push a string like that. Stack <INPUTWOSPACES> "\n"
Then, we use the ` trick again, and Replace, which gives our output.

Is this supposed to work in firefox?

I'm running it in firefox, is there an issue? Can you get a screenshot?

cracked?

Well that was fast. I nearly lasted half an hour!

Beam, 72 bytes, Safe!
Now for a 2d language. Can be played with on TIO Nexus.
s'''>`+++)+Ss`n\
 n`sS+(+++`<``/
 >rgn\
 ^ @<(\
     H         <
 ^    /

A fairly straight forward program without a lot in there to try and fool people.
s'''>`+++)+Ss`n\ # Sets the memory slot 0 to 0, 10 to 10 and 32 to 32. n will redirect down
 n`sS+(+++`<``/  # since memory != store. \ is a red herring and not hit.
 >rgn\           # read in from input and set store to memory value. For all characters
 ^ @<(\          # other than space, LF and end of input this will be different and n will
     H         < # redirect down then through to the print and back to read. Space, LF and
 ^    /          # end of input get directed to the ( which tests for 0. This will redirect
                 # space and LF to path back to read, otherwise it will skip over and halt

I think I'll move the interpreter to Node when I have time so Dennis can add it to TIO...

I've created a Node clone of the interpreter, and Dennis has now added it to TIO!

Labyrinth, 127 bytes
);""{"".@"-;,""""":"##"*"(:"+":}-;{";;"*#{:;"#""+("-;"";;"})"";""""""""

Hopefully I did this right :) this is my first cops and robbers entry.
Original Code
 ) ;""{"".@
"-;, "" ""
"  :
" ##
" *
" (:
"  +
"  :}-;{
"    ; ;
" *#{: ;
" #    "
" +("-;"
"    ; ;
"    })"
"      ;
""""""""

Your answer is now safe, you can add your original code and an explanation.

C, 140 bytes, cracked by Riley
Let's start with an easy one.
#include<stdio.h>intmain(){inta=getchar();while(a!=EOF){//\a=getchar();if(a!=10&&a!=32)//\\putchar(a^10^32);putchar(a);a=getchar();}}

(I hope I'm doing this right.)

Cracked. Not the indended solution as I have 1 less byte.

@Riley add an extra newline on the end and you'll be fine ;)

Befunge 98, 65 bytes, cracked by Pietu1998
~v>#@>::':'0--\'[';--!8v1+!*1+j!j,v>#@

Original program
~v           >#@
 >::':'0--\'[';--!8v1+!
*1+j !j,     v     >
#@

I think I got it.

JavaScript ES6, 380 bytes, safe
This is the kind of entry that I was initially planning to release. It's huge and has nearly no chance to win, but I think it should be cryptographically strong enough to withstand 7 days. Now, I may be proven wrong!
67 bytes of whitespace to add.
s=>{for(k=`|||`.split`|`.map(s=>s.replace(/\s/g,c=>(k-=(c<'')+1,n=n<<2|k&3),k=n=0)&&n),x=10106050295,y=-4955405499,i=32,d=2654435769,t=d*i;i--;y-=(x<<4^x>>>5)+x^t+k[t>>>11&3],t-=d,x-=(y<<4^y>>>5)+y^t+k[t&3]);returns[atob(([x,y].map(n=>String.fromCharCode(n&255,n>>8&255,n>>16&255,n>>24)).join``))](/[\n]/).join``}

Solution
This is an implementation of the Extended Tiny Encryption Algorithm. The 64-bit whitespace-encoded key expands to the following 128-bit key:
K = [0xd224de37, 0x89e34e79, 0xe34e7748, 0x939e2789]

Source: Wikipedia
Once decrypted and converted to ASCII, the 64-bit block [x, y] reads as c3BsaXQ=, which is the Base64 encoded representation of split.

let f =

s=>{for(k=`

|

  |

|

 `.split`|`.map(s=>s.replace(/\s/g,c=>(k-=(c<' ')+1,n=n<<2|k&3),k=n=0)&&n),x=10106050295,y=-4955405499,i=32,d=2654435769,t=d*i;i--;y-=(x<<4^x>>>5)+x^t+k[t>>>11&3],t-=d,x-=(y<<4^y>>>5)+y^t+k[t&3]);return s[atob(([x,y].map(n=>String.fromCharCode(n&255,n>>8&255,n>>16&255,n>>24)).join``))](/[ \n]/).join``}

console.log(f(`H e l l o
W o r l d`))

I started brute forcing this thinking maybe I'll get lucky and you made each of the 4 key values have the same length (8 bits). Except it would be 16 bits each... woops. Brute force isn't going to happen, time for another approach.

Whitespace, 81 74 bytes, Cracked!

Human readable version:
ttttttttttttttttttttt (21 tab characters)

I know this is an old challenge but hopefully someone is willing to have a go at cracking this. I attempted to optimise for bytecount but it may be possible to make something shorter with the same number of tab characters.
Original Solution

Try it online!
Explanation
ssstsssssn ; push 32
nssn  ; label ''
sns   ; dup 32 to use as address
tnts  ; getchar and store at address 32
sns   ; dup 32 to use for later subtraction
sns   ; dup 32 to use as address
ttt   ; retrieve character value
tsst  ; subtract 32 - char
ntsn  ; jez '' if result is 0 char was a space, loop without output
sns   ; dup 32 to use as address
ttt   ; retrieve character value
ssststsn ; push 10
tsst  ; subtract char - 10
ntsn  ; jez '' if result is 0 char was a linefeed, loop without output
sns   ; dup 32 to use as address
ttt   ; retrieve character value
tnss  ; putchar since it was not a space or linefeed
nsnn  ; jump '' loop

I didn't keep notes for this solution but I think I'd tried to keep the stack low by retrieving the value repeatedly which also inflated the tab count. The hope was to force a slightly unusual approach to meet the target tab count.
@thaliaarchi's 65 byte solution saves characters by leaving non-space/newline characters on the stack when it loops, this was an alternative approach I considered but didn't end up going with (though I also had a higher bytecount there :D). The 68 byte cracked solution with reordered comparisons and a -0 constant to match the required tab count very neatly hits the target with a tidy byte saving, only leaving garbage on the stack when a newline is encountered.

By the way, I cracked this recently at https://codegolf.stackexchange.com/a/258852

V, 37 bytes Cracked by nmjcman101
OVrS200@"kIi|D@"Aüî|D@"
Since this has unprintables, here is the readable version:
O<esc>Vr<C-a>S200<esc>@"kIi<C-v><C-v><esc>|D@"<esc>Aüî<esc>|D@"

Or if you prefer, a hexdump:
00000000: 4f1b 5672 0153 3230 301b 4022 6b49 6916  O.Vr.S200.@"kIi.
00000010: 161b 7c44 4022 1b41 fcee 1b7c 4440 22    ..|D@".A...|D@"

Cracked That was a really cool puzzle

Minkolang v0.15, 88 bytes, Cracked!
$oI[dd""=$r'10'=1J,?1R]r$O3.14$$$Cdollars>$$$Ceverywhere>x

Try it online!

cracked?

Vitsy, 73 bytes, safe
This is downright evil.
5mW3m7m7m2mD&EPamX}<m15mEnl9mZD\[4m]^P-cm(D_2-3*bmD1-dmrnu-'

Good luck! 13 items of whitespace to add.
Original code:
5m
W3m7m
7m
2m
D&EPamX}
<m1
5mEn
l9mZ
D
\[4m]
^P-cm(D
_2-3*
bmD1-dmrnu-
'

Try it online!
This roughly simplifies down to:
<m1
W2\[2m]Z
l\[D&EP^P-_2-3*D1-rnu-(DX}]

Please do not look at the edit history, as I had a bug in my code remaining.

You do not know evil. I know evil.

It is just past 0300 for me, so I'll add an explanation in the morning.

reticular, 43 bytes, cracked
ISBqv<>>$$4jE:d/v$v?c+91d/v?E;!?l$/o$

The version on TIO is outdated, but you can get yourself a copy from the github.

The version on Nexus was already up-to-date. I pulled on v1 as well.

Just checking, does this work if the input contains two consecutive linefeeds?

@MartinEnder it should. It depends on whether or not the input is piped or not. When piped it should read all of stdin.

@Dennis thanks! I meant to ask you in chat.

Cracked

Wolfram, 132
Probably has more that one solution (hint: Mersenne)
StringReplace[#,""->"",Limit[x/(x-1),x->Boole[PrimeQ[
212821282128228281282128228821282128212821282-1]]]]&

Solution
StringReplace[#," "->"",Limit[x/(x-1),x->Boole[PrimeQ[
2 128 2 128 2 128 2 2 8 2 8 128 2 128 2 2 8 8 2 128 2 128 2 128 2 128 2-1]]]]&

Your submission will then be your source code with all whitespace removed

@KritixiLithos It is removed

What about the spaces before the second line and the newline between the first and second line?

Well, you're right, it is just for readability...

I think you can post the solution now.

@CalculatorFeline Forgot about this one completely, thx!

C#, 159 bytes, Cracked by milk
usingSystem.Linq;s=>string.Join("",string.Join("",s.Split(@"".Replace(newstring((char)0x0D,1),"").ToCharArray())).Select(c=>c+""!=""?c+"":"").ToArray());

153 collapsed so only 6 bytes of whitespace to find, shouldn't be too hard...

Cracked

S.I.L.O.S, 159 bytes Safe!
loadLinedef:lblgetagetzzzz/za=256:aX=getax=Xy=Xz=xx-10x|ifxbGOTOx:by-32y|ifycGOTOx:cprintCharX:xa+1z+1x=getaifxa:b

Should be fairly trivial. It is my first cops and robbers entry.
No one attacked it, probably due to the esoteric nature of my own language. Seems like a sleazy way to slide by, but it doesn't really matter as shorter ones are safe.
loadLine
def : lbl geta get z zz
z/z
a=256
:a
X=get a
x=X
y=X
z=x
x-10
x |
if x b
GOTO x
:b
y-32
y|
if y c
GOTO x
:c
printChar X
:x
a+1
z+ 1
x=get  a
if x a
:b

Feel free to try it online

Vyxal 3, 11 bytes, 1 whitespace needed
#?“""₉r""₉r

Try it Online!
Should be really really easy.

You need to say how much whitespace is added.

Cracked

Vyxal, 11 bytes, 7 whitespace, cracked by lyxal
#ȧ‛(#FṘ₴#Ṙ‛

Try it Online! Should be pretty easy.
Lyxal got my intended solution exactly.

tcc, 850 bytes
To avoid pasting a very long line I passed this through tr -d '\n ' | fold -b -w 60.
#!/usr/bin/tcc-run#include<stdio.h>typedefunsignedcharu;um[]
={104,105,16,152,94,131,43,42,112,214,53,207,116,170,185,210
};intmain(){uS[256];uk[256];ui,j,t;intc,n=0;FILE*f;f=fopen(_
_FILE__,"r");/*cannotfail*/while(-1!=(c=fgetc(f)))if(c==''||
c==10)k[++n]=c;fclose(f);i=0;do{S[i]=i;}while(++i!=0);j=0;i=
0;do{j=j+S[i]+k[i%n];t=S[i];S[i]=S[j];S[j]=t;}while(++i!=0);
i=0;do{if(S[i]!=m[i])j=1;}while(++i<sizeof(m));if(j==1){i=0;
do{printf("%d,",(int)S[i]);}while(++i<sizeof(m));printf("\n"
);}else{while(-1!=(c=fgetc(stdin)))if(c!=''&&c!=10)fputc(c,s
tdout);}returnj;}

Link to interpreter?

@VoteToClose: apt-get install tcc did it for me.