text:
Recognize a vine
Background
I have a bunch of old and grainy black-and-white images.
Some of them depict vines climbing on a wall, others don't – your task is to classify them for me.
Input and output
Your input is a rectangular 2D array of bits A, given in any convenient format.
It will not be empty, but it's not guaranteed to contain both 0s and 1s.
The array depicts a vine if the following conditions hold:

The bottom row of A contains at least one 1. These are the roots of the vine.
Every 1 in A is connected to the bottom row by a path of 1s that only goes left, right and down (not up, and not diagonally). These paths are the branches of the vine.

Your output is a consistent truthy value if the input depicts a vine, and a consistent falsy value otherwise.
Examples
This array depicts a vine:
0 0 1 0 0 1
0 1 1 0 0 1
0 1 0 1 1 1
1 1 0 1 0 1
0 1 1 1 0 1
0 0 1 0 1 1

This input does not depict a vine, since there's a 1 at the middle of the right border that's not connected to the roots by a branch:
0 0 0 1 1 0
0 1 0 1 1 1
0 1 0 1 0 1
0 1 1 1 1 0
0 0 1 1 0 1

The all-0 array never depicts a vine, but the all-1 array always does.
Rules and scoring
You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
Test cases
Truthy inputs:
1

0
1
1

01
11

0000
0111
1100
1001

1111
1111
1111
1111

001001
011001
010111
110101
011101
001011

1011011
1001001
1111111
0100000
0111111
1111001
1001111
1111101

0000000
0011100
0010100
0011100
0001000
1111111
0001000
0011100
0010100
0010100

Falsy inputs:
0

1
0

10
01

000
000
000

011
110
000

111111
000000
101011
111001

010010
001000
000010
110001

001100
111111
110101
010011
111011

000110
010111
010101
011110
001101

11000000
10110001
10011111
11110001
01100011
00110110
01101100
01100001
01111111

Didn't realize that vine can't grow downwards, had a nice idea using connected components of a graph, sigh...

@swish All that means is that removing each row in turn must continue to result in a graph connected to a line of 1s at the bottom.

Snails, 25 19 17 bytes
&
\0z),(\1dlr)+d~

Try it online!
Explanation
Snails is a 2D pattern-matching language inspired by regex, which was originally developed for our 2D pattern matching language design challenge.
The & makes Snails try the pattern from every possible starting position and prints 0 or 1 depending on whether the pattern fails in any of them or matches in all of them.
Now Snails can work with implicit parentheses, so the pattern is shorthand for the following:
(\0z),(\1dlr)+d~

The , acts like a * in regex (i.e. match zero or more times), whereas the + is the same as in regex (match one or more times). So we start by matching \0z as often as necessary, which matches a single 0 and then allows the snail to reset its direction arbitrarily with z. This allows zeros in the input, provided a valid vine cell can be found anywhere else.
Then we match at least one \1dlr, which matches a single 1 and then allows the snail to reset its direction either down, left or right. Note that if the cell we've started at contains a 1 then we're only matching this part. It basically allows the snail to traverse a vine from a branch down to the roots.
Finally, we need to ensure that we did reach the ground by looking for an out-of-bounds cell (~) below (d).

I'm pleasantly surprised that anyone was able to follow the documentation :)

JavaScript (ES6), 135 bytes
s=>s.replace(/^[^1]*\n/,``).split`
`.map(s=>+`0b${s}`).reverse(g=(n,m,o=(m<<1|m|m>>1)&n)=>n-m?o-m&&g(n,o):n).reduce((m,n,i)=>g(n,n&m))

Note: Due to limitations of integer type, only works for vines of up to 31 characters wide. Explanation: Each row is bitwise ANDed with the adjacent row to determine the connection points, and then the g function is used to recursively expand the row horizontally until it can expand no more. For instance, if two adjacent rows are 1110111 and 1011100 then the connection points are 1010100 and this is then expanded to 1110110 and then 1110111 which then finds that the row is connected. If the g function fails then it returns zero which causes all subsequent g functions to fail too, and the result is then falsy. If the g function succeeds it returns the new row which is then propagated through the reduce to test the next row.
s=>s.replace(/^[^1]*\n/,``)         Remove irrelevant leading "blank" rows
    .split`\n`                      Split into lines
    .map(s=>+`0b${s}`)              Convert into binary
    .reverse(                       Process from bottom to top
     g=(n,m,o=(m<<1|m|m>>1)&n)=>     Expand row horizontally
      n-m?o-m&&g(n,o):n)             Check whether rows are connected
    .reduce((m,n,i)=>g(n,n&m))      Check all rows

I'll rule that 31 characters is wide enough, and this approach is valid.

Python 2, 254 bytes
No libraries
def f(A,r=0,c=-1):
 B=A[r];R=len(A)-1;C=len(B);i=1 in A[R]
 if c<0:
    for j in range(R*C+C):
        if A[j/C][j%C]:i&=f(A,j/C,j%C)
    return i&1
 _=B[c];B[c]=0;i=_&(r==R)
 if _:
    if c>0:i|=f(A,r,c-1)
    if r<R:i|=f(A,r+1,c)
    if c<C-1:i|=f(A,r,c+1)
 B[c]=_;return i

Note that the second and third level indents are formed with tabs in the byte count.
Try it online

Wolfram - 254
Spend some time making this work, so I'll just leave it here:
f[s_]:=(
v=Characters@StringSplit@s;
{h,w}=Dimensions@v;
g=GridGraph@{w,h};
r=First/@Position[Flatten@v,"0"];
g=VertexDelete[Graph[VertexList@g,
EdgeList@g/.x_y_/;Abs[x-y]>1yx],r];
v=VertexList@g;
v≠{}∧v~Complement~VertexOutComponent[g,Select[v,#>w h-w&]]{}
)

Basically I construct a grid graph with directed edges pointing up, remove vertices that correspond to 0s, check that bottom vertex components contain all vertices. Ridiculous, I know...

Why is this non-competing?

At present we would consider this "not an answer" since it isn't golfed. If you simply remove unnecessary whitespace and add a byte count, I see no reason why this should be non-competing.

Python + NumPy 204 202 195 Bytes
from numpy import*
def f(A):
 r,c=A.shape
 z,s=zeros((r,1)),array([0,2,c+3])
 B=hstack((z,A,z)).flat
 for i in range(1,(r-1)*(c+2)):
    if B[i]and not any(B[s]):return 1<0
    s+=1
 return any(B[i:])

Expects A to be a 2D numpy array.
Takes the matrix, pads zero columns left and right and flattens the matrix. s is a stencil that points to the left, right and lower element. The loop checks each element except the last line if it is 1 and at least one of its stencil is 1, returns False otherwise. Afterwards, check if the last line contains any 1.
Two testcases for you:
I1 = '001001\n011001\n010111\n110101\n011101\n001011'
A1 = array([int(c) for c in I1.replace('\n','')]).reshape(6,6)
print f(A1) #True

I2 = '001100\n111111\n110101\n010011\n111011'
A2 = array([int(c) for c in I2.replace('\n','')]).reshape(5,6)
print f(A2) #False

Edit1: 1<0 is shorter than False
Edit2: flat is a fine alternative to flatten() and using tabulators for the second intendation in the loop


text:
Collide against walls
Statement
Given an input like this 35 15 0 0 10 that matches the following constrains:

Width in characters of the grid (5-50)
Height in characters of the grid (5-25)
Initial X position of the ball (0-(Width-1)
Initial Y position of the ball (0-(Height-1)
Number of movements to simulate

Generate a grid that shows the trajectory of the ball, knowing it's direction is initially DR (down-right) and that colliding with a wall will reverse the increment being applied to that axis. In other words, if we are going DR and hit the bottom we will now be going UR until we collide again.
The trajectory is not affected by passing twice over the same point since it's not the game snake, it's the trajectory of an object in 2d.
The input will be a string such as the one above and the output should be similar to this, not caring about which characters represent the wall, trajectory or ball, as long as they're consistent.

Points
Your score is the length of your submission, in characters.
Winners by language

var QUESTION_ID=81035,OVERRIDE_USER=19121;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

The border characters are not ASCII

That's why it's a bonus to have them

@JuanCortés I think he means they aren't ascii art then.

Oh God, nitpicking.. Unicode art? I'm not changing it :)

Some languages don't support non-ASCII chars. Can the border be formed with say +-| symbols?

Sure, that's fine with me.

A reminder that code golf winners are the entries with the lowest score, so your inverse scoring system doesn't really make sense.

Is input order and format flexibile as usual? For example, can number of movements be first input and [width height] be taken as an array?

Fair enough, fixed

Input flexibility up to your discretion, just don't be too cheeky

As you probably know, bonuses are frowned upon. For example, why 50 and not 40? It's up to you, but consider removing that part

I'm the worst then.. Bonus removed!

Sorry to keep suggesting changes. We usually score in bytes, not in chars. Chars is acceptable, but is it intentional?

Your example figure seems to have 48 movements, not 50. Can you check?

I've cleaned up the post a bit - are you sure you want scoring by characters and not bytes? There are several very good reasons why we typically score by bytes nowadays.

Sure, change it

MATL, 35 34 characters
Z"42Gi:qi!+lGqE!/tYo-KM!*|QYoZ}X](

Try it online!
Explanation
This takes care of the reflections using the formulas
nx = 2*(Nx-1)
px = abs(t/nx-round(t/nx))*nx

where t is a time variable that increases in steps of 1, Nx is the maximum size along the x direction and px is the computed x position. Analogous formulas are used for the y coordinate.
A char matrix of spaces is initially created, and then it is filled with character * at the computed x and y positions.
Z"     % Implicitly take [width height]. Push char matrix of spaces with that size
42     % Push 42. ASCII for character `*`
G      % Push first input again, that is, [width height]
i      % Take number of movements, M
:q     % Range [0 1 ... M-1]
i!     % Take initial position [x y]. Transpose into column vector
+      % Add element-wise with broadcast. Gives 2-row vector
lG     % Push first input, [width height]
qE!    % Transform into column vector [2*width-2; 2*height-2]
/      % Divide element-wise with broadcast
tYo    % Duplicate. Round to closest integer
-      % Subtract
KM!    % Push [2*width-2; 2*height-2] again
*      % Multiply element-wise with broadcast
|      % Absolute value
Q      % Add 1
Yo     % Round to closest integer
Z}     % Separate 2-row array into two row arrays. These contain row and column
       % indices, respectively, of the ball positions
X]     % Convert row and colummn indices to linear index
(      % Assign 42 to those positions of the matrix of spaces

This looks like black magic!

Python 180 172 171 163 145 Bytes
(-2 Bytes with Python3)
def r(m,n,x,y,t):
 s=([' ']*m+['\n'])*n;a=b=1
 for c in'o'*(t-1)+'x':s[x+y*m+y],x,y=c,x+a,y+b;a*=2*(0<x<m-1)-1;b*=2*(0<y<n-1)-1
 print''.join(s)

To save 2 more bytes with Python3 (thanks to shooqie) replace second line with
 s=[*' '*m,'\n']*n

Had to use a list of characters because python does not support string item assignement. The x+y*m+y part is from x+y*(m+1) because of the '\n' add each line end
Edit1: right after posting, saw how to get rid of the overwriting 'x'
Edit2: space after print
Edit3: using < and > instead ==, also tabs for 2nd indentation
Edit4: Replaced the if statements with assignements, daisy-chaining less-than and placing the loop in one line (thanks to RootTwo)

Not sure if it works in Python 2, but you can do s=[*' '*m,'\n']*n instead of s=([' ']*m+['\n'])*n. Also, I believe you can omit the space between print and ''.join(s) as well as the space between x==0 (y==0) and or

Does not work in Python 2 and now I don't want to switch languages, but I'll put your suggestion into the post.
The space after print can be omitted, the one before or not

Simple statements can be put on one line and separated by ;.  This removes the bytes used by the leading indent.  For example:  s=([' ']*m+['\n'])*n;a=b=1 eliminates the ' ' before the a saving one byte (the ';' basically replaces the '\n').  Changing the if statements to assignment statements would let the for i... loop go on a single line and save another 6 bytes.

@RootTwo Merging the if statements into the assignement did not work for me, since they rely on the updated positions. I also could not find a shorter way of assignement instead of if.

Try 'a*=2*(0<x<m-1)-1' instead of if x<1 or x>m-2:a=-a.  Same for y and b.  The loop can be for c in 'o'*(t-1)+x:, then 'xo'[i<t-1] becomes c.

@RootTwo yes, that's great!

JavaScript, 293 279
Nothing too clever going on here.
EDIT: Saved 14 characters by initialising the 2D array differently.

p=prompt().split(' ')
a=[];for(i=0;i++<p[1];)a.push(new Array(~~p[0]).fill(' '))
x=~~p[2];y=~~p[3]
d=e=1
for(i=0;i++<p[4];){a[y][x]=i==p[4]?'x':'o'
if(x<1&&d<0||x>p[0]-2&&d>0)d*=-1
if(y<1&&e<0||y>p[1]-2&&e>0)e*=-1
x+=d;y+=e}o=''
for(i=0;i++
Array(size).fill' ')(replace '-s with a back tick

You should specify the input format. With 35 15 0 0 10 I don't get the expected result

Array.fill is ES6, in which case you might as well use [..." ".repeat(p[0])]

R, 156 bytes/chars
As an unnamed function. It's quite long but I quite like the method.  There's probably a better way to do the 1 to w to 1 vector.
function(w,h,x,y,i)cat(c(' ','o')[1:(w*h)%in%(rep(c(c(1:w),c((w-1):2)),i)[x:((i=i-1)+x)+1]+(rep(c(c(1:h),c((h-1):2)),i)*w-w)[y:(i+y)+1])*1+1],fill=w,sep='')

Brief explanation of function internals
cat(                                                 # output to STDOUT
  c(' ','o')                                         # vector of characters
    [1:(w*h)%in%(                                    # number of characters in the board
      rep(c(c(1:w),c((w-1):2)),i)[x:((i=i-1)+x)+1]+  # oscillating vector of x to w to 1 to x
      (rep(c(c(1:h),c((h-1):2)),i)*w-w)[y:(i+y)+1]   # similar to above but in steps of w
    *1+1]                                            # cause a vector of 1 or 2 to pick char
  ,fill=w,sep='')                                    # print width of w, no separator

Like the other current answers this doesn't output the border, but I will add one if required.

Javascript ES6 202 181 177 chars
(w,h,x,y,s)=>(a=(r=Array)(h).fill().map(_=>r(w).fill` `),eval("for(vx=vy=1;s--;x+=vx,y+=vy,a){a[y][x]=0;if(!x||x==w-1)vx*=-1;if(!y||y==h-1)vy*=-1;}"),a.map(r=>r.join``).join`
`)

Not very golfed, I take a another look at it once I get home.

Score is in chars here.

@ΈρικΚωνσταντόπουλος The count is the same in chars too

Your header should say "chars"/"char" or "characters"/"character". Not "bytes"/"byte".

array comps. + Array.keys might save you some bytes

C++11, 355 Bytes
Takes input string as command line arguments
#include <iostream>
#define A(n,i) int n=atoi(a[i]);
int main(int,char**a) {
A(w,1)A(h,2)A(x,3)A(y,4)A(n,5)
int d=1,r=1;
auto b=new int64_t[h];
while(--n>1){
b[y]|=1<<x;
if(r)x++;else x--;
if(d)y++;else y--;
if(x==0||x==w-1)r=!r;
if(y==0||y==h-1)d=!d;
}
for(int i=0;i<h;++i){
for(int j=0;j<w;++j){
std::cout<<(x==j&&y==i?'x':b[i]&(1<<j)?'o':' ');
}
std::cout<<'\n';
}
}

Don't worry about the newlines, they are already removed from the count.
Storing the rows as 64-Bit integer is okay since maximum width is 50.

Q, 94 Bytes (kx.com)
{[w;h;i;j;n]./[(1+h,w)#" ";+{z#y_+\0,-1 1@{x=2*_x%2}'&(-_-(z+y)%x)#x}.'(h,j,n;w,i,n);:;"*"]}.
Defines a lambda with parameters w (width), h (height), i (initial x), j (initial y), and n (number of movements).
Lambda is delimited with {}
Final . (after }) allows to use a sequence as argument. Standard function invocation is f[arg;arg;..;arg], but we can also invoque as f . sequence. An integer sequence is v v .. v, so we can invoque as f . w h i j n. If we define f:{..}. we can invoque as f w h i j n (as required by the question)
Solution uses 'K mode' of Q. K is the functional inner core of Q (Q is more readable, verbose and with a lot of additional libraries, but K is compact). To execute in K mode we must use scripts with k extension (vs q extension for q mode). Interactive interpreter starts in Q mode (-> q) prompt). We can load code from k script, and execute test directly on interactive interpreter (even in q mode, as shown in test). There is also a k mode at interactive interpreter level, but it's not worth in this case.
TEST
NOTE.- to avoid display cluttering, we assume f name associated to lambda (f:{..}.)
q)f 35 15 0 0 49
"*                             *     "
" *                           * *    "
"  *                         *   *   "
"   *                       *     *  "
"    *                     *       * "
"     *                   *         *"
"      *                 *         * "
"       *               *         *  "
"        *             *         *   "
"         *           *         *    "
"          *         *         *     "
"           *       *         *      "
"            *     *   *     *       "
"             *   *     *   *        "
"              * *       * *         "
"               *         *          "
q)f 35 15 4 2 49
"                                *   "
"                               * *  "
"    *                         *   * "
"     *                       *     *"
"      *                     *     * "
"       *                   *     *  "
"        *                 *     *   "
"         *               *     *    "
"          *             *     *     "
"           *           *     *      "
"            *     *   *     *       "
"             *     * *     *        "
"              *     *     *         "
"               *   * *   *          "
"                * *   * *           "
"                 *     *            "

EXPLANATION
We define a lambda for 1D movement that accepts args [max;init;n] (legal positions 0..max-1, initial pos init, n movements) and returns a sequence of positions (after computing rebounds). Later apply that lambda to y and x axes (with args [h;j;n] and [w;i;n] respectively).

Initially assume starting at 0 pos. We calculate number of rebounds to accomplish n movements, and generate a sequence with repeated increasing numbers (0 0 ...0; 1 1 .. 1; 2 2  .. 2; ..).
Each subsequence has w items, so there are rebounds just between subsequences. For each number determine if is even, and sustitutes even results by 1 and even results by -1. (1 1 .. 1; -1 -1 .. -1; 1 1 .. 1; ..)
We join subsequences and calculate accumulated sums starting with 0 -> 0 1 2 3 .. 35 34 33 32 .. 0 1 2 ..
finally we drop starting i movements and take exactly n movements

Last, we define a (h x w) char matrix filled with blanks, and for each position (resulting of applying 1D lambda on y and x) we replace character with "*"

source: Stack Exchange

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

sort: votes


text:
Self Referential Polynomials
For every given degree \$n\$ it is possible to construct (at least one) an integral polynomial \$p \in \mathbb Z[X]\$ such that \$p(k)\$ (\$p\$ evaluated in \$k\$) is the coefficient of the term \$x^k\$ in the polynomial for all \$0 \leqslant k \leqslant n\$. To make them unique, we require the leading coefficient (the coefficient of \$x^n\$) to be positive and minimal.
These polynomials have some interesting properties, you can find some references in the thread that inspired me to do this challenge. You can also find those polynomials in https://oeis.org/A103423
One of the a priori unexpected properties is how the roots behave depending on \$n\$:

source (by /u/zorngov and /u/EpicSauceSc2)
Task
Given a nonnegative integer \$n\$ output the self referential integral polynomial of degree \$n\$ with minimal positive leading coefficient.
Details
The output can be in any human readable form, as string x^2-x-1, or also as a list of coefficients [1,-1,-1]. (The order of the coefficients can also be the other way around, it just needs to be consistent.)
First few outputs
n=0: 1
n=1: x
n=2: x^2-x-1
n=3: 10*x^3-29*x^2-6*x+19
n=4: 57*x^4-325*x^3+287*x^2+423*x-19
n=5: 12813*x^5-120862*x^4+291323*x^3+44088*x^2-355855*x-227362

Congrats on your gold badge!

@LuisMendo Thanks, apparently I'm a fanatic.

Mathematica, 55 bytes
NullSpace@Table[x^c-Boole[r==c]/.x->r,{r,0,#},{c,0,#}]&

Output is the list coefficients, beginning from the constant term. Example:
In[1084] := Do[Print[%1077[n] // StandardForm], {n, 0, 7}]

{{1}}

{{0,1}}

{{-1,-1,1}}

{{19,-6,-29,10}}

{{-19,423,287,-325,57}}

{{-227362,-355855,44088,291323,-120862,12813}}

{{145991969,64989065,-123338281,-85635661,79841909,-18146731,1286795}}

{{-5958511844199,3384370785404,8437850634901,489428412300,-4499161007143,1776194531596,-258931801371,13131073916}}

This simply finds the vector such that (A - I)v = 0, similar to the MAPLE code in OEIS. The NullSpace method seems to always pick the minimal positive number for the last element, which matches the task description.
The x^c-…/.x->r indirection is to prevent having 0^0 == Indeterminate.

Sage, 74 bytes
lambda n:kernel(matrix(n+1,[j^-i-(-i==j)for i in[-n..0]for j in[0..n]])).0

The -i and [-n..0] could be i and [0..n], if not for the positive leading coefficient requirement.
Try it on Sage Cell

Pari/GP, 57 bytes
n->(a=matkerint(matrix(n++,,i,j,i--^j--)-1))*sign(a[n,1])

Try it online!
Returns the coefficients as a column vector.

Julia, 172 bytes
Similar to the Mathematica code in OEIS.

Try it online!
using LinearAlgebra
function f(n)
n=n+1
V=nullspace([ifelse(k == 1, 1, (j - 1)^(k - 1)) for j in 1:n, k in 1:n] - I)[:,1]
if(V[end]<0) V=-V;end
(V/maximum(V))[end:-1:1]
end

Here, these coefficients are normalized by dividing by the maximum value of the coefficients.
How to adjust the code?
using LinearAlgebra

function VM(n)
    return [ifelse(k == 1, 1, (j - 1)^(k - 1)) for j in 1:n, k in 1:n]
end

function f(n)
    V = nullspace(VM(n + 1) - I)
    V = V[:, 1] # Get the first column
    if V[end] < 0
        V = -V
    end
    return (V / maximum(V))[end:-1:1] # Normalize and reverse
end

for n in 0:10
    print(f(n), "\n")
end

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

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


text:
Find the smallest number bigger than the input whose digital sum is the input
"Digital sum" refers to the sum of all the digits in a number.
For example, the digital sum of 1324 is 10, because 1+3+2+4 = 10.
The challenge is to write a program/function to calculate the smallest number bigger than the input whose digital sum is the input.
Example with walkthrough
As an example, take the number 9 as the input:
9 = 1+8 -> 18
9 = 2+7 -> 27
9 = 3+6 -> 36
...
9 = 8+1 -> 81
9 = 9+0 -> 90

The valid output would be the smallest number above, which is 18.
Specs
Note that 9 is not the valid output for this example, because the reversed number must be greater than the original number.
Note that the input will be positive.
Test-Cases:
 2 => 11      (2 = 1 + 1)
 8 => 17      (8 = 1 + 7)
12 => 39     (12 = 3 + 9)
16 => 79     (16 = 7 + 9)
18 => 99     (18 = 9 + 9)
24 => 699    (24 = 6 + 9 + 9)
32 => 5999   (32 = 5 + 9 + 9 + 9)

References:
This is OEIS A161561.
Edit: Added an additional Testcase (18)
Thanks to Martin Ender for the Leaderboard Snippet

var QUESTION_ID=81047,OVERRIDE_USER=31373;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

This title made my brain hurt.

05AB1E, 19 17 8 bytes
Code:
[>DSO¹Q#

Explained:
[            # start infinite loop
 >           # increase loop variable, will initially be input
  DSO        # make a copy and sum the digits
     ¹Q#     # if it equals the input, break
             # else return to start of loop
             # implicitly print

Try it online
Edit: Saved 9 bytes thanks to @Adnan

SO is a shorter way to get the sum of digits (instead of J`)O). Also, without variable assignment, you can do [>DSO¹Q# :).

@Adnan. Nice! I totally missed S. Should have realized I didn't need the variables.

Python 2, 33 bytes
lambda n:[n+9,`n%9`+n/9*'9'][n>9]

A direct expression. Makes a number string with 9's at the end and the remainder at the beginning. Except, for single-digit n, gives n+9.
Some outputs have leading zeroes (099 for 18).

Pyth, 8 bytes
fqQsjT;h

Test suite.
fqQsjT;h

f      h first number T from (input+1) onward where:
 qQ          the input is equal to
   s         the sum of
    jT;      the base-10 representation of T

Retina, 39 31 bytes
r`1{1,9}
$.&
T`d`_d`^.$
^.$
1$&

Takes input in unary.
Try it online! (The first two lines allows running several test cases at once and converts from decimal to unary for  convenience.)
This doesn't actually search for the result linearly, but computes it explicitly:

If the input n is greater than 9, we replace it with n % 9 followed by n / 9 (floored) nines.
Otherwise, we replace it with n + 9.

Using ! (or anything else that isn't 1) as the unary digit, I can save one more byte with the following approach:
^!(?!!{9})
1
r`!{0,9}
$.&
0\B

But this input format is a bit of a stretch, I think.

So Retina won't allow Integer input or just can't handle Integer arithmetic?

@levanth There is no arithmetic at all in Retina - the entire language is based on string processing via regular expressions, so all the arithmetic is usually done on unary representations. Retina could take decimal integer input and convert it to unary first, but that costs 6 additional bytes, and our policies allow unary input unless the challenge specifies decimal. (If you would rather require all answers to take decimal input, feel free to say so in the specification and I'll update my answer.)

no no its okay ^^ I was just curious about the unary input

Java 7, 68 61 bytes
int f(int n){return n>9?-~(n%9)*(int)Math.pow(10,n/9)-1:n+9;}

Does roughly the same thing as many of the other answers here. Wanted to show the Java approach without using string manipulation and loops.
Thanks to FryAmTheEggman for reminding me that I'm dumb ;)

At least you outgolfed SQL?

Meh, only twice as large as most python/ruby answers here, so I don't feel too bad for Java right now. It would've been nice to beat C though :P

:/ Oops, got that from my class block. I must be rusty at this.

@Geobits It would probably beat C--.

@Fry Completely forgot about that trick. Thanks, that put me ahead of C at least ;)

What does the -~ represent? I've never seen something like that.

MATL, 10 9 bytes
`QtV!UsG-

Try it online!
Explanation
`        % Do...while
  Q      %   Add 1. Takes input implicitly the first time
  t      %   Duplicate
  V!Us   %   To string, transpose, to number, sum. Gives sum of digits
  G-     %   Subtract input. If 0, the loop ends and the stack is implicitly displayed

Clever use of V!U +1 from me. That should go in our list of MATL idioms.

@Suever Yes, that gets used quite often

JavaScript (ES7), 32 bytes
n=>(n%9+1)*10**(n/9|0)-(n>9||-8)

38 bytes as ES6:
n=>parseFloat(n%9+1+'e'+n/9)-(n>9||-8)

Python 3, 128 94 84 74 Bytes
Without output, direct approach, beginner codegolfer ;)
def r(n):
 m=n
 while 1:
  m+=1
  if sum(map(int,str(m)))==n:return(m)

What code did you count for your Bytelength?

the one posted here. If I need to include the printing, I can add that as well.
I do notice that it has put spaces instead of \t, which increases my bytelength..

For starters, there are a lot of spaces that can be removed. Before/after =+() for example.

Also you can replace print(m) with return m (doesn't save any bytes but you don't have to print in the function itself). You can still print the output function return with print(r(n)) to test your function

You can also remove lots of newlines; m=n+1;f=1 and if s==n:f=0

When replacing print with return, you can do it directly in the if-statement and remove f as well as the else-statement.

thanks guys, while not really pythoneque anymore, it is a lot smaller :D

Well this is codegolf ^^ so PEP 8 doesn't count here :D

Btw you can remove the () in the return statement: return m (saves 1 Byte)

You can still remove f and just use while 1: and also remove the space between int(c) and for

@ShadowFlame I edited your title to show up in the leaderboards perhaps you would like to review my edit. Information for the Leaderboard Snippet can be found here

Are the square brackets needed?

@LeakyNun I think yes but he can but the sum(...) part dircetly in the if condition to replace s

the square brackets are needed yes, but I can indeed replace the s by the summing. It would save me 4 or 5 bytes I think

You can still remove the s variable and replace it with sum(map(int,\m`))`

Great answer for a beginner golfer. But just check this will work in python. Indentation counts and your actual byte length is 84 if formatted correctly

single space indent is valid indentation for python, and it should count it..

Brachylog, 8 bytes
<.=:ef+?

= was modified after this challenge got posted, so that it now works on possibly infinite domains, which is the case here.
Explanation
<.       Output > Input
  =      Label the Output (i.e. unify it with an integer)
   :ef   Get the list of digits of the Output
      +? Input is the sum of all those digits

This will backtrack on = until the value of Output makes this whole predicate true.

Actually, 17 bytes
╗1`;$♂≈Σ╜;)=)>*`╓

Try it online!
Explanation:
╗1`;$♂≈Σ╜;)=)>*`╓
╗                  save input to reg0
 1`;$♂≈Σ╜;)=)>*`╓  first integer n (>= 0) where:
   ;$♂≈Σ╜;)=         the base-10 digital sum equals the input and
            )>*      is greater than the input

This answer is great because it's flirty (;))

Python 2, 39 bytes
lambda n:[n+9,(1+n%9)*10**(n/9)-1][n>9]

Pure integer arithmetic.
Full program with output
f=lambda n:[n+9,(1+n%9)*10**(n/9)-1][n>9]

print(f(2))
print(f(8))
print(f(12))
print(f(16))
print(f(17))
print(f(18))
print(f(24))
print(f(32))

Output:
11
17
39
79
89
99
699
5999

I like the way that this formulation avoids the leading zero.

@Neil the other one could avoid it by using eval

Racket 70 characters, 71 bytes
Same algorithm as most of the others pretty much. Pretty sad about not having % for modulo, or ** for expt, or integer division by default, otherwise this could be a lot shorter and I could've outgolfed C and Java. Still love the language though
(λ(x)(if(> x 9)(-(*(+(modulo x 9)1)(expt 10(floor(/ x 9))))1)(+ x 9)))

Ruby, 33 bytes
This is a int arithmetic version that just happens to be the same as xnor's python answer. It is an anonymous function that takes and returns an int.
->n{n<10?n+9:(1+n%9)*10**(n/9)-1}

I don't know ruby that much but is the -> at the start an anonymous function?

@levanth: yes. I will clarify above

Does not work for n=9

@GB thank you for pointing that out. It is now fixed.

C 73 65 bytes
A macro with a helper function.
e(y){return y?10*e(y-1):1;}
#define F(n) n<9?n+9:(1+n%9)*e(n/9)-1

The e function just calculates powers of ten, and the F macro uses the same solving method as this ruby, and this python answer. sadly, it is longer than about the same length as both those answers put together. But it is the first C answer.
(8 bytes saved by  Lynn's trick of removing int.)

You can drop both occurrences of int, saving 8 bytes.

TSQL(sqlserver 2012), 107 99 bytes
DECLARE @ INT = 32

,@2 char(99)WHILE @>0SELECT
@2=concat(x,@2),@-=x FROM(SELECT IIF(@>9,9,IIF(@2>0,@,@-1))x)y PRINT @2

Try it online!

Wow! I didn't expect that!

Lua, 52 bytes
n=...+0
print(n>9 and(n%9)..string.rep(9,n/9)or n+9)

Meant to be saved in a file and run with the Lua interpreter, e.g. lua <file> <input number>
You can also try it here: https://repl.it/CXom/1
(On repl.it the input number is hard-coded for ease of testing)

What does the '...+0' do...? Does it cast the input to an integer?

Yep, to a number (Lua before 5.3 only used doubles, like JavaScript). Lua will automatically convert strings to numbers in expressions, but not comparisons. So in order for n>9 to work properly it needs to be coerced to a number first.

+1! I see. So ...+0>9 would work?

Yep! It would :)

Perl 6,  38  29 bytes
{$_>9??(1+$_%9)*10**Int($_/9)-1!!$_+9}
{first *.comb.sum==$_,$_^..*}
( apparently the direct approach is shorter )
Explanation:
{
  first
    *.comb.sum == $_, # lambda that does the check
    $_ ^.. *          # Range.new: $_, Inf, :excludes-min
}

Test:
#! /usr/bin/env perl6

use v6.c;
use Test;

my @tests = (
   2 => 11,
   8 => 17,
   9 => 18,
  12 => 39,
  16 => 79,
  18 => 99,
  24 => 699,
  32 => 5999,
);

plan +@tests;

my &next-digital-sum = {first *.comb.sum==$_,$_^..*}

for @tests -> $_ ( :key($input), :value($expected) ) {
  is next-digital-sum($input), $expected, .gist;
}

1..8
ok 1 - 2 => 11
ok 2 - 8 => 17
ok 3 - 9 => 18
ok 4 - 12 => 39
ok 5 - 16 => 79
ok 6 - 18 => 99
ok 7 - 24 => 699
ok 8 - 32 => 5999

Hexagony, 40 31 30 bytes
<_:->.(.+><.'!.\@"9!%>!/{.}|.?

Or, if you prefer your code to be a little less linear and a little more polygonal:
    < _ : -
   > . ( . +
  > < . ' ! .
 \ @ " 9 ! % >
  ! / { . } |
   . ? . . .
    . . . .

Try it online!
Thanks to @FryAmTheEggman for some ideas and inspiration :o)
Previous version: <.:->+_.!(..'!.\><9!%>@.{.}|.?"
Previouser version: <><.-_|@"'!{|(.9+!8=@>{/".'/:!?$.%\1$..\

This seems to work? Still looks golfable.

@FryAmTheEggman Nice work! 2 minutes after posting this I thought of a much better way to do, well, pretty much everything. Tunnel vision, probably? I'm working on a revised version.

Thanks :) Just an FYI people often chat about Hexagony in the esoteric programming languages room. Join in if you want :)

Managed to smoosh it in a bit more: http://hexagony.tryitonline.net/#code=ICAgPyB7IDkgJwogICcgKCAuIDwgPgogQCA-ICsgISBfIEAKLSA8ID4gJSAhIDogXAogfSBfICQgPiAhIC4KICAuIC4gXCB9IDwKICAgLiAuIC4gLg&input=MzI

Shakespeare Programming Language, 456 bytes
,.Ajax,.Ford,.Page,.Act I:.Scene I:.[Enter Ajax and Ford]Ford:Listen tothy.Ajax:You be I.[Exit Ajax][Enter Page]Scene V:.Page:You be the sum ofyou a cat.Remember you.Ford:You zero.Scene X:.Ford:You be the sum ofyou the remainder of the quotient betweenI twice the sum ofa cat a big big cat.Page:You be the quotient betweenyou twice the sum ofa cat a big big cat.Be you nicer zero?If solet usScene X.Recall.Am I as big as Ajax?If notlet usScene V.Open heart

Try it online!

MathGolf, 8 7 bytes
Æ)_Σk=▼

Try it online!
Implicit input yay.
Explanation:
          Implicit input
 Æ     ▼  Do while false loop that pops the condition
  )       Increment top of stack
   _      Duplicate
    Σ     Get the digit sum
     k    Get input
      =   Is equal?
          Implicit output

I know this is an older answer, but you can solve it in 7 bytes now with implicit input (just skip the first k).

Desmos, 57 49 bytes
-8 bytes thanks to Aiden Chow!
f(n)=\{n<9:n+9,(\mod(n,9)+1)10^{\floor(n/9)}-1\}

Try it on Desmos!

49 bytes. Please see this tip for more details on removing \left's and \right's from piecewise expressions.

@AidenChow Thanks! I was originally stumped by how removing \left and \right broken my functions - turns out all I had to do was to add a \!

Pyke, 9 8 7 bytes
.fhsq)h

Try it here!
.f      - first where true:
  h     - n+1
   sq    - digital_root(^) == input()
      h - that number +1

Tested again, your solution gives not the correct output for the inputs 1 to 8

I think I broke it... Works except for the number 1. Btw why does Missing arg to Equals, evaling input come up? I mean I give it an input number

@levanth That happens because by default the web interface has warnings turned on. I've just coded a way to turn that off (like 10 mins ago). As for why it didn't work for 1, I was checking to see if the number was bigger than 10 and if so continuing.

PHP, 77 characters
$n=$argv[1];$m=$n+1;while(1){if(array_sum(str_split($m))==$n)die("$m");$m++;}

Oracle SQL 11.2, 165 bytes
SELECT l FROM(SELECT LEVEL l,TO_NUMBER(XMLQUERY(REGEXP_REPLACE(LEVEL,'(\d)','+\1')RETURNING CONTENT)) s FROM DUAL CONNECT BY 1=1)WHERE s=:1 AND l!=s AND rownum=1;

Un-golfed
SELECT l
FROM   (
         SELECT LEVEL l, -- Number to evaluate
                XMLQUERY(
                          REGEXP_REPLACE(LEVEL,'(\d)','+\1')  -- Add a + in front of each digit
                          RETURNING CONTENT
                        ).GETNUMBERVAL()s                     -- Evaluate le expression generated by the added +
                FROM DUAL
                CONNECT BY 1=1 -- Run forever
       )
WHERE s=:1      -- The sum must be equal to the input
  AND l!=s      -- The sum must not be the input
  AND rownum=1  -- Keep only the first result

Java 10, 114 62 bytes
n->{var r="";for(int i=0;i++<n/9;r+=9);return(n>9?n%9:n+9)+r;}

Try it online.
EDIT: 130 73 bytes without leading zeros (Thanks to @levanth`):
n->{var r="";for(int i=0;i++<n/9;r+=9);return new Long((n>9?n%9:n+9)+r);}

Try it online.
Explanation:
n->                           // Method with integer parameter and long return-type
  var r="";                   //  Result-String, starting empty
  for(int i=0;i++<n/9;r+=9);  //  Append `n` integer-divided by 9 amount of 9's to `r`
  return new Long(            //  Cast String to number to remove any leading zeroes:
    (n>9?                     //   If the input `n` is 10 or larger
      n%9                     //    Use `n` modulo-9
     :                        //   Else (`n` is smaller than 10):
      n+9)                    //    Use `n+9`
    +r);}                     //   And append `r`

If anyone is interested: The fix would be seven bytes longer, replace String c(int n){return""+(n>9?(n%9)+s(n):n+9);} with int c(int n){return Integer.parseInt((n>9?(n%9)+s(n):n+9));}

@levanth I've edited it in. Btw, you forgot the ""+ in int c(int n){return Integer.parseInt(""+(n>9?(n%9)+s(n):n+9));}

JavaScript (ES2015), 45 39 33 bytes
Saved another 6 bytes thanks to @Conor O'Brien and @Shaun H.
I think I'll leave it as is, because this version differs from @Neil's answer by using String.repeat().
v=>+(v>9?v%9+'9'.repeat(v/9):v+9)

Previous version (saved 6 bytes thanks to @Qwertiy):
f=v=>+(v/9>1?v%9+'9'.repeat(v/9|0):v+9)

First version:
f=v=>+(v/9>1?v%9+'9'.repeat(~~(v/9)):'1'+v-1)

~~(v/9) => v/9|0, '1'+v-1 => v+9

@Qwertiy Thank you very much. I need to learn more about bitwise operators. About the second change, it looks like I overcomplicated the case for v <= 9. I'll think if I can return all numeric values, which could be another byte-saver (no .repeat() and wrapping return value in +()).

You don't need to name the function as per our rules

v>9 is 2 bytes shorter, string.repeat will floor a decimal value no |0 needed

Also differs from my answer by not using ** of course.

PowerShell v2+, 62 bytes
param($n)for($a=$n+1;([char[]]"$a"-join'+'|iex)-ne$n;$a++){}$a

Takes input $n then executes a for loop. We initialize the loop by setting our target number, $a, to be one larger than $n (since it has to be bigger, plus this ensures 1..9 work correctly). Each loop we increment $a++. Nothing happens in the loop proper, but the conditional is where the program logic happens. We're literally taking the target number as a string, casting it as a char-array, -joining the array with + and then piping it to iex (similar to eval). We test whether that's equal to our input number or not, and continue looping accordingly. Once we've exited the loop, we've reached where our target number is digit-sum equal to our input number, so $a is placed on the pipeline and output is implicit.

For reference, here's the "construct a string with the appropriate number of 9's" method that other folks have done, at 67 bytes
param($n)(($n+9),(+(""+($n%9)+'9'*(($n/9)-replace'\..*'))))[$n-gt9]

or the "pure integer arithmetic" method that other folks have done, at 70 bytes
param($n)(($n+9),("(1+$n%9)*1e$(($n/9)-replace'\..*')-1"|iex))[$n-gt9]

Neither of which are shorter, but both of which are more interesting.

You can save 3 bytes: param($n)for($a=$n+1;([char[]]"$a"-join'+'|iex)-$n){$a++}$a

Ruby, 38 bytes
f=->n{n<11?n+9:"#{n<19?n-9:f.(n-9)}9"}

This answer returns a string or int depending on input size. It is a recursive solution that asks for a solution for 9 less then adds a "9" to the end.

Ruby, 39 bytes
f=->n{n<11?n+9:(n<19?n-9:f.(n-9))*10+9}

For one more byte, this answer always returns an int. same algorithm as above but with numbers.

C, 80 bytes
i;s;g(j){s=0;for(;j;j/=10)s+=j%10;return s;}f(n){i=n;while(n-g(i))i++;return i;}

Ungolfed try online
int g(int j)
{
    int s=0;
    for(;j;j/=10) s += j%10;
    return s;
}

int f(int n)
{
    int i=n;
    for(;n-g(i);i++);
    return i;
}

Python 3 55 Bytes
Takes two arguments that are the same
f=lambda a,b:a if sum(map(int,str(a)))==b else f(-~a,b)

i.e. to call it you would use f(x,x)

Japt, 9 bytes
@¶Xìx}aUÄ

Try it

Powershell, 54 bytes
$args|%{(($_+9),+(''+$_%9+'9'*(($_-$_%9)/9)))[$_-gt9]}

Test script:
$f = {

$args|%{(($_+9),+(''+$_%9+'9'*(($_-$_%9)/9)))[$_-gt9]}

}

@(
    ,(  1,  10   )
    ,(  2 , 11   )
    ,(  8 , 17   )
    ,(  9 , 18   )
    ,( 10,  19   )
    ,( 11,  29   )
    ,( 12 , 39   )
    ,( 16 , 79   )
    ,( 18 , 99   )
    ,( 19 , 199  )
    ,( 24 , 699  )
    ,( 27 , 999  )
    ,( 32 , 5999 )
    ,( 52 , 799999 )
    ,( 128, 299999999999999 )
) | % {
    $a,$e = $_
    $r = &$f $a
    "$($r-eq$e): $r"
}

Output:
True: 1 : 10
True: 2 : 11
True: 8 : 17
True: 9 : 18
True: 10 : 19
True: 11 : 29
True: 12 : 39
True: 16 : 79
True: 18 : 99
True: 19 : 199
True: 24 : 699
True: 27 : 999
True: 32 : 5999
True: 52 : 799999
True: 128 : 299999999999999

Expalantion

if [$_-gt9] returns a first digit and a tail

a first digit is the difference between $_ and the sum of 9 ($_%9)
a tail is a few nines - '9'*(($_-$_%9)/9))
finally, converts a result string into a number to remove the leading 0

else returns ($_+9)

GolfScript, 22 bytes
~:x{).10base{+}*x=!}do

Try it online!
Any tips are appreciated--I feel like this could be shorter.
Explanation
~:x{).10base{+}*x=!}do
~                       Eval the input (casting from string to integer)
 :x                     Store a copy in x
   {               }do  Run a do...while loop using this block:
    )                    Increment
     .                   Duplicate
      10base             Convert the number to a list of base-10 digits
            {+}*         Fold on + (sum the digits)
                x        Push x (the original input)
                 =       Test if the sum equals the original input
                  !      Negate, so the loop condition is true while the sum does *not* equal the
                         original input

When the loop exits, we have a number on the stack whose digit sum equals the original input. It is guaranteed to be greater than the original input because the loop, which begins by incrementing the number, executes at least once. Finally, when the program terminates, the stack is autoprinted.

Haskell, 44 bytes
f x|x>9=(2+mod(x-1)9)*10^div(x-1)9-1|x>0=9+x

Try it online!
Uses math. In pseudocode:
If x > 9, return:
  ((x-1) mod 9 + 2) * 10 ^ ((x-1) / 9) - 1
Else if x > 0, return:
  9 + x

TI-Basic, 25 bytes
₁₀^(iPart(Ans/9))(9fPart(Ans/9)+1)-1+9(Ans≤9

Takes input in Ans. Output is stored in Ans and is displayed.

Thunno 2, 5 bytes
⁺µƘS=

Try it online!
Explanation
⁺µƘS=  # Implicit input
⁺      # Starting at (input + 1)...
 µƘ    # ...find the first integer where...
   S=  # ...the sum equals the input
       # Implicit output

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


text:
Implement SHA-256
Given a sequence of bytes, output the SHA-256 hash value of the sequence.
The SHA-256 Algorithm
The following pseudocode is taken from the Wikipedia page for SHA-2.
Note 1: All variables are 32 bit unsigned integers and addition is calculated modulo 2^32
Note 2: For each round, there is one round constant k[i] and one entry in the message schedule array w[i], 0 ≤ i ≤ 63
Note 3: The compression function uses 8 working variables, a through h
Note 4: Big-endian convention is used when expressing the constants in this pseudocode,
    and when parsing message block data from bytes to words, for example,
    the first word of the input message "abc" after padding is 0x61626380

Initialize hash values:
(first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):
h0 := 0x6a09e667
h1 := 0xbb67ae85
h2 := 0x3c6ef372
h3 := 0xa54ff53a
h4 := 0x510e527f
h5 := 0x9b05688c
h6 := 0x1f83d9ab
h7 := 0x5be0cd19

Initialize array of round constants:
(first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311):
k[0..63] :=
   0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
   0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
   0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
   0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
   0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
   0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
   0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
   0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2

Pre-processing:
append the bit '1' to the message
append k bits '0', where k is the minimum number >= 0 such that the resulting message
    length (modulo 512 in bits) is 448.
append length of message (without the '1' bit or padding), in bits, as 64-bit big-endian integer
    (this will make the entire post-processed length a multiple of 512 bits)

Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk
    create a 64-entry message schedule array w[0..63] of 32-bit words
    (The initial values in w[0..63] don't matter, so many implementations zero them here)
    copy chunk into first 16 words w[0..15] of the message schedule array

    Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array:
    for i from 16 to 63
        s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)
        s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10)
        w[i] := w[i-16] + s0 + w[i-7] + s1

    Initialize working variables to current hash value:
    a := h0
    b := h1
    c := h2
    d := h3
    e := h4
    f := h5
    g := h6
    h := h7

    Compression function main loop:
    for i from 0 to 63
        S1 := (e rightrotate 6) xor (e rightrotate 11) xor (e rightrotate 25)
        ch := (e and f) xor ((not e) and g)
        temp1 := h + S1 + ch + k[i] + w[i]
        S0 := (a rightrotate 2) xor (a rightrotate 13) xor (a rightrotate 22)
        maj := (a and b) xor (a and c) xor (b and c)
        temp2 := S0 + maj

        h := g
        g := f
        f := e
        e := d + temp1
        d := c
        c := b
        b := a
        a := temp1 + temp2

    Add the compressed chunk to the current hash value:
    h0 := h0 + a
    h1 := h1 + b
    h2 := h2 + c
    h3 := h3 + d
    h4 := h4 + e
    h5 := h5 + f
    h6 := h6 + g
    h7 := h7 + h

Produce the final hash value (big-endian):
digest := hash := h0 append h1 append h2 append h3 append h4 append h5 append h6 append h7

Reference implementation
Here is a reference implementation, in Python 3:
#!/usr/bin/env python3

import sys

# ror function modified from http://stackoverflow.com/a/27229191/2508324
def ror(val, r_bits):
   return (val >> r_bits) | (val << (32-r_bits)) % 2**32

h = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]

k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
   0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
   0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
   0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
   0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
   0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
   0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
   0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]

s = sys.stdin.read().encode()
msg = [int(x,2) for c in s for x in '{:08b}'.format(c)]
msg.append(1)
while len(msg) % 512 != 448:
    msg.append(0)
msg.extend([int(x,2) for x in '{:064b}'.format(len(s) * 8)])

for i in range(len(msg)//512):
    chunk = msg[512*i:512*(i+1)] # sloth love chunk
    w = [0 for _ in range(64)]
    for j in range(16):
        w[j] = int(''.join(str(x) for x in chunk[32*j:32*(j+1)]),2)
    for j in range(16, 64):
        s0 = ror(w[j-15], 7) ^ ror(w[j-15], 18) ^ (w[j-15] >> 3)
        s1 = ror(w[j-2], 17) ^ ror(w[j-2], 19) ^ (w[j-2] >> 10)
        w[j] = (w[j-16] + s0 + w[j-7] + s1) % 2**32
    work = h[:]
    for j in range(64):
        S1 = ror(work[4], 6) ^ ror(work[4], 11) ^ ror(work[4], 25)
        ch = (work[4] & work[5]) ^ (~work[4] & work[6])
        temp1 = (work[7] + S1 + ch + k[j] + w[j]) % 2**32
        S0 = ror(work[0], 2) ^ ror(work[0], 13) ^ ror(work[0], 22)
        maj = (work[0] & work[1]) ^ (work[0] & work[2]) ^ (work[1] & work[2])
        temp2 = (S0 + maj) % 2**32
        work = [(temp1 + temp2) % 2**32] + work[:-1]
        work[4] = (work[4] + temp1) % 2**32
    h = [(H+W)%2**32 for H,W in zip(h,work)]

print(''.join('{:08x}'.format(H) for H in h))

Restrictions

The usage of builtins which compute SHA-256 hashes or otherwise trivialize the challenge is forbidden
The input and output may be in any reasonable format (encoded in a single-byte encoding, base64, hexadecimal, etc.)

Test cases
<empty string> -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
abc -> ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Hello, World! -> c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31
1234 -> 03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4

J, 458 445 443 438 435 430 421 bytes
3 :0
B=.32#2
A=.B&#:
P=.+&#.
'H K'=.A<.32*&2(-<.)2 3%:/p:i.64
for_m._512]\(,(1{.~512|448-#),(,~B)#:#)y
do.w=.(,B#:(15&|.~:13&|.~:_10|.!.0])@(_2&{)P/@,(25&|.~:14&|.~:_3|.!.0])@(_15&{),_7 _16&{)^:48]_32]\m
'a b c d e f g h'=.H=.8{.H
for_t.i.64
do.u=.A]P/((e<g)~:e*f),h,(~:/26 21 7|."{e),t{&>K;w
v=.A(a*b)P(c*a~:b)P~:/30 19 10|."{a
h=.g
g=.f
f=.e
e=.A]d P u
d=.c
c=.b
b=.a
a=.A]u P v
end.
H=.A]H P a,b,c,d,e,f,g,:h
end.
,H
)

Try it online!
This is a monadic verb that takes a list of bits as input and outputs a list of bits. On TIO, conversion from string to list of bits for the input and list of bits to hexadecimal is implemented for convenience. To test other input, just modify the text in the input field.

This is beautiful

@Mego Thanks, there's still some redundant parts that could probably be golfed away to maybe save 10 or so bytes.

I'd love to see a tacit version :P

If only 13 supported multi-line definitions and assignments also.

As of J 8.06, there is now a builtin for using SHA-256 and other hashes, 128!:6. Example

Python 2, 633 bytes
n=range
f=2**32
q=512
r=lambda v,b:v%f>>b|(v<<32-b)%f
t=int
g=lambda e:[t(x**e%1*f)for x in n(2,312)if 383**~-x%x==1]
h=g(.5)
k=g(1/3.)
m=map(t,input())
l=len(m)
m+=[1]+[0]*((447-l)%q)+map(t,'{:064b}'.format(l))
for i in n(l/q+1):
 c=m[q*i:][:q];w=[t(`c[j*32:][:32]`[1::3],2) for j in n(16)];x=h[:8]
 for j in n(48):a,o=w[j+1],w[j+14];w+=[(w[j]+(r(a,7)^r(a,18)^(a>>3))+w[j+9]+(r(o,17)^r(o,19)^(o>>10)))%f]
 for j in n(64):a,o=x[::4];d=x[7]+(r(o,6)^r(o,11)^r(o,25))+(o&x[5]^~o&x[6])+k[j]+w[j];e=(r(a,2)^r(a,13)^r(a,22))+(x[1]&a|x[2]&a|x[1]&x[2]);x=[d+e]+x[:7];x[4]+=d
 h=[(H+W)%f for H,W in zip(h,x)]
print''.join('%08x'%H for H in h)

This solution is the result of a collaboration between myself, Leaky Nun, and Mars Ultor. As such, I've made it community wiki out of fairness. It takes input as a binary string wrapped in quotes (e.g. '011000010110001001100011' for abc) and outputs a hex string.

At least it's clear how it works? :)

Python 2, 519 bytes
Q=2**32
G=lambda e:[int(x**e%1*Q)for x in range(2,312)if 383**~-x%x<2]
H=G(.5)[:8]
r=lambda v,b:v>>b|v<<32-b
M=input()
l=len(M)
M+=bin(l|1<<(447-l)%512+64)[2:]
while M:j=0;a,b,c,d,e,f,g,h=H;exec"H+=int(M[:32],2),;M=M[32:];"*16+"x=H[-15];y=H[-2];H+=(H[-16]+H[-7]+(r(y,17)^r(y,19)^y>>10)+(r(x,7)^r(x,18)^x/8))%Q,;"*48+"u=(r(e,6)^r(e,11)^r(e,25))+(e&f^~e&g)+h+G(1/3.)[j]+H[j+8];X=a,b,c,d,e,f,g,h=(u+(r(a,2)^r(a,13)^r(a,22))+(a&b^a&c^b&c))%Q,a,b,c,(d+u)%Q,e,f,g;j+=1;"*64;H=tuple(a+b&Q-1for a,b in zip(H,X))
print"%08x"*8%H

I was working off the pseudocode, but some parts just ended up being the same as the golfed reference Mego posted since there's not much to golf (e.g. the constant tables, for which the only real golf was a <2 instead of ==1). Over 100 bytes down though, but I'm sure there's still more to be gotten.
Input/output is also string of bits to hex string.

I think you can alias int, which would save 2B. I'm not that familiar with golfing in Python, so there might still be a few more bytes you can save. Also, what does the x**e%1*Q do? I ran some tests with some random values for x and e, but it always returned 0...

@L.Serné int is only used twice, so aliasing wouldn't save anything. x**e%1 gives fractional part, so you'd have to test with fractional e for the intended effect.

C, 1913 1822 bytes (just for fun)
#define q unsigned
#define D(a,c)x->b[1]+=a>1<<33-1-c;a+=c;
#define R(a,b)(a>>b|a<<32-b)
#define S(x,a,b,c)(R(x,a)^R(x,b)^x>>c)
#define W(i,a)i=x->s[a];
#define Y(i,a)x->s[a]+=i;
#define Z(_,a)h[i+a*4]=x->s[a]>>(24-i*8);
#define J(a)x->d[a]
#define T(_,a)x->d[63-a]=x->b[a/4]>>8*(a%4);
#define Q(_,a)x->s[a]=v[a];
#define A(F)F(a,0)F(b,1)F(c,2)F(d,3)F(e,4)F(f,5)F(g,6)F(h,7)
#define G(a,b)for(i=a;i<b;++i)
typedef struct{q char d[64];q l,b[2],s[8];}X;q k[]={0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2},v[]={0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19};a(X*x){q a,b,c,d,e,f,g,h,i,t,z,m[64];G(z=0,16)m[i]=J(z++)<<24|J(z++)<<16|J(z++)<<8|J(z++);G(i,64)m[i]=S(m[i-2],17,19,10)+m[i-7]+S(m[i-15],7,18,3)+m[i-16];A(W);G(0,64){t=h+(R(e,6)^R(e,11)^R(e,25))+(e&f^~e&g)+k[i]+m[i];z=(R(a,2)^R(a,13)^R(a,22))+(a&b^a&c^b&c);h=g;g=f;f=e;e=d+t;d=c;c=b;b=a;a=t+z;}A(Y)}i(X*x){x->l=*x->b=x->b[1]=0;A(Q)}p(X*x,char*w,q l){q t,i;G(0,l){J(x->l)=w[i];if(++x->l==64){a(x);D(*x->b,512)x->l=0;}}}f(X*x,char*h){q i=x->l;if(i<56){J(i++)=128;G(i,56)J(i)=0;}else{J(i++)=128;G(i,64)J(i)=0;a(x);G(0,56)J(i)=0;}D(*x->b,x->l*8)A(T)a(x);G(0,4){A(Z)}}

I took the reference implementation and started golfing, my target was under 2k.
Can be improved if somebody knows how to generate the constants (cube root of primes, I can't think of any golf-friendly way).
Usage:
X ctx;
unsigned char hash[32];

i(&ctx);                    // initialize context
p(&ctx,text,strlen(text));  // hash string
f(&ctx,hash);               // get hash

Golfed constant generator (still golfable though).
Try it online!

More golfed constant generator 275 bytes


text:
N-uniquely additive sets
Remember that a set is unordered without duplicates.
Definition An N-uniquely additive set S whose length is K is a set such that all N-length subsets in S sum to different numbers. In other words, the sums of all the N-length subsets of S are all distinct.
Objective Given an array/set as input and a number N to a function or to a full program in any reasonable format, find and return or output a truthy or falsey value (erroring for falsey is okay) denoting whether or not the input is N-uniquely additive.
You may assume that each element only appears at most once and that each number is within your language's native datatype. If need be, you may also assume that the input is sorted. Last, you may assume that 0 < N <= K.
Examples
Let's consider the set S = {1, 2, 3, 5} and N = 2. Here are all the sums of all unique pairs over S (for the unique ones are the only ones of interest for sums):
1 + 2 = 3
1 + 3 = 4
1 + 5 = 6
2 + 3 = 5
2 + 5 = 7
3 + 5 = 8

We can see that there are no duplicates in output, so S is 2-uniquely additive.

Let's now consider the set T = {12, 17, 44, 80, 82, 90} and N = 4. Here are all the possible sums of length four:
12 + 17 + 44 + 80 = 153
12 + 17 + 44 + 82 = 155
12 + 17 + 44 + 90 = 163
12 + 17 + 80 + 82 = 191
12 + 17 + 80 + 90 = 199
12 + 17 + 82 + 90 = 201
12 + 44 + 80 + 82 = 218
12 + 44 + 80 + 90 = 226
12 + 44 + 82 + 90 = 228
12 + 80 + 82 + 90 = 264
17 + 44 + 80 + 82 = 223
17 + 44 + 80 + 90 = 231
17 + 44 + 82 + 90 = 233
17 + 80 + 82 + 90 = 269
44 + 80 + 82 + 90 = 296

They are all unique, and so T is 4-uniquely additive.
Test Cases
[members], N => output
[1, 4, 8], 1 => true
[1, 10, 42], 1 => true                ; all sets trivially satisfy N = 1
[1, 2, 3, 4], 3 => true
[1, 2, 3, 4, 5], 5 => true
[1, 2, 3, 5, 8], 3 => true
[1, 2, 3, 4, 5], 2 => false           ;  1 +  4       =  5 =        2 + 3
[-2, -1, 0, 1, 2], 3 => false         ; -2 + -1 + 2   = -1 =   -2 + 0 + 1
[1, 2, 3, 5, 8, 13], 3 => false       ;  1 +  2 + 13  = 16 =    3 + 5 + 8
[1, 2, 4, 8, 16, 32], 3 => true
[1, 2, 4, 8, 16, 32], 4 => true
[1, 2, 4, 8, 16, 32], 5 => true
[1, 2, 4, 8, 16, 32], 6 => true
[3, 4, 7, 9, 12, 16, 18], 6 => true
[3, 4, 7, 9, 12, 16, 18], 3 => false  ; 3 + 4 + 12 = 19 = 3 + 7 + 9

You mean N <= K?

@Neil Yes, I do. Sorry!

Does an error count as something falsey?

@flawr Sure, I'll accept that

MATL, 7 bytes
XN!sSdA

Try it online!
Returns true (displayed as 1) or false (displayed as 0).
XN   % Take array S and number N. Generate all combinations of elements from S
     % taken N at a time. Gives a 2D array where each combination is a row
!    % Transpose. Each combination is now a column
s    % Sum of each column: gives a row array. If N=1 computes the sum of
     % the only row, and so gives a number
S    % Sort vector
d    % Array of consecutive differences. For a single number gives an empty array
A    % True if all elements of the input array are nonzero (for an empty array
     % it also gives true)

Jelly, 7 bytes
œcS€ṢIP

Try it online!
Returns a positive number for truthy and zero for falsey.
œc       find combinations
  S€     sum each combination
    Ṣ    sort the sums
     I   find the difference between each pair of sums
           iff any sums are the same, this returns a list containing 0
      P  product of the elements of the resulting list

Matlab, 78 bytes
function n=f(s,n);p=perms(s);k=sum(unique(sort(p(:,1:n)),'rows')');unique(k)-k

This function returns a positive value (in fact n) for truthy and returns an error as a falsey answer (valid according to this comment)
Explanation:
function n=f(s,n);
p=perms(s); %create all permutations of the set

k=sum(unique(sort(p(:,1:n)),'rows')');
                  %just take the first n entries of each permutation
             %sort those entries and
      %filter out all duplicates (we sorted as the order should NOT matter)
  %then sum each of those candidates

unique(k)-k
%if all those sums are distinct, unique(k) will have the same size
% as k itself, and therefore we can subtract, otherwise it will throw
% an error as we try to subtract vectors of different sizes

Why does it error?

I just added an explanation. The error comes from the last line. It causes an error if we have duplicates in k. PS: Matlab syntax highlighting finally works!!!

Good idea to return the same n!

Pyth, 8 bytes
{IsM.cFQ

Test suite.
       Q   eval input (provided as a 2-element array)
    .cF    splat over combination
  sM       sum each combination
{I         is the result invariant under { (dedup/uniq)?

What does splat mean?

@CᴏɴᴏʀO'Bʀɪᴇɴ Same thing it means in every other language: use an array as the arguments to a function.

Oh, right, I'm dumb :p thanks

in every other language that actually has this function

I fixed the bug that required that Q at the end.

And now you can update your answer per the new policy over language versions made after the challenge was posted. Oh, and the F actually means Fold, not splat.

Haskell, 69 bytes
import Data.List
n#s=(==)=<<nub$[sum x|x<-subsequences s,length x==n]

Usage example: 6 # [3,4,7,9,12,16,18] -> True.
Direct implementation of the definition: make a list of sums of all subsequences of length n and check if it equals itself with duplicates removed.

JavaScript (ES6), 132 bytes
(a,n)=>a.map(m=>{for(i=n;i--;)s[i].map(k=>s[i+1].push(m+k))},s=[...Array(n+1)].map(_=>[]),s[0]=[0])&&new Set(s[n]).size==s[n].length

Builds up the additive lists from 1 to n and then checks the last one for uniqueness.

Julia, 46 41 bytes
x\n=(t=map(sum,combinations(x,n)))==t∪t

Try it online!
How it works
This (re)defines the binary operator \ for Array/Int arguments.
combinations(x,n) returns all arrays of exactly n different elements of x. We map sum over these arrays and store the result in t.
t∪t performs the set union of the array t with itself, which works like the longer unique in this case.
Finally, we compare t with the deduplicated t, returning true if and only if all sums are different.

Python, 89 bytes
from itertools import*
lambda s,n,c=combinations:all(x^y for x,y in c(map(sum,c(s,n)),2))

Test it on Ideone.
How it works
c(s,n) lists all n-combinations of s, i.e., all lists of n different elements of s. We map sum over the resulting lists, thus computing all possible sums of sublists of length n.
After wards, we use c(...,2) to create all pairs of the resulting sums. If any two sums x and y are equal, x^y will return 0 and all will return False. Conversely, if all sums are unique, x^y will always be truthy, and any will return True.

Brachylog, 20 bytes
:1f:+aLdL
[L:I]hs.lI

Expects a list containing the list and then the integer as Input, and no Output, e.g. run_from_atom(':{[L:I]hs.lI}f:+aLdL', [[1:2:3:5]:2])..
Explanation

Main Predicate
           Input = [A:I]
:1f        Find all ordered subsets of A of length I
   :+aL    Apply summing to each element of that list of subsets. Call that L
       dL  True if L minus all duplicate elements is still L

Predicate 1: Find all ordered subsets of fixed length of a list
[L:I]      Input = [L:I]
     hs.   Unify Output with an ordered subset of L
        lI True if I is the length of Output

J, 34 bytes
load'stats'
[:*/@~:[:+/"1(comb#){]

Straight-forward approach, only requires the stats add-on for the comb function. Returns 0 for false and 1 for true.
As an alternative to using the comb builtin, there is a 38 byte solution that generates the power set and chooses the subsets of size n.
[:*/@~:(>@{[:(</.~+/"1)2#:@i.@^#)+/@#]

Usage
   f =: [:*/@~:[:+/"1(comb#){]
   2 f 1 2 3 5
1
   4 f 12 17 44 80 82 90
1
   3 f _2 _1 0 1 2
0
   6 f 3 4 7 9 12 16 18
1
   3 f 3 4 7 9 12 16 18
0

Wow, didn't know about the stats module. Very nice!

I just found out about it too, I haven't really delved much into the add-ons in J. If I was more brave, I'd attempt the graphics add-ons.

Ruby, 50 bytes
->s,n{!s.combination(n).map{|c|c.inject :+}.uniq!}

Try it online!
If all elements are unique, uniq! returns nil. Negating that result, as in !(...).uniq! makes for a nice uniqueness test.
This question was posted a few weeks before Ruby 2.4.0-preview1, which introduced Enumerable#sum, which would save 9 bytes here.
41 bytes (Ruby 2.4+)
->s,n{!s.combination(n).map(&:sum).uniq!}

Try it online!

R, 41 bytes
function(s,n)max(table(combn(s,n,sum)))<2

Sums all n-length subsets of s and checks if all values in a contingency table of these sums are 1 (all sums are unique).
Try it online!


text:
Swap bits with their neighbours
Task description
Given an integer, swap its (2k–1)-th and 2k-th least significant bits for all integers k > 0. This is sequence A057300 in the OEIS.
(The number is assumed to have “infinitely many” leading zeroes. In practice, this simply means prepending a single 0 bit to odd-length numbers.)

This is code-golf, so the shortest code (in bytes) wins.
Test cases
0 -> 0
1 -> 2
9 -> 6
85 -> 170
220 -> 236
1827 -> 2835
47525 -> 30298

Can we assume the number fits as an int for things like bit shifts?

@xnor: I think that’s the default/community consensus (otherwise answers in C etc. would always be wrong)? So sure! :)

@Lynn: C requires unsigned char array_of_bytes[1024] to work the way you expect (i.e. be a bitfield with 1024 * CHAR_BIT entries).  I'd imagine most answers supporting arbitrary-length inputs would assume CHAR_BIT was even, though, since shifting bits between bytes is cumbersome.  So you absolutely could put a requirement to support k up to some constant size, like 256 or something that's reasonable for AES, and languages without 256bit integer types would have to use loops.  That might make SIMD vectors worth considering for an x86 asm answer :P

I swap @Geobits with Minibits

Jelly, 10 9 7 bytes
b4d2UFḄ

Try it online! or verify all test cases.
How it works
b4d2UFḄ  Main link. Argument: n (integer)

b4       Convert n to base 4.
  d2     Divmod each quaternary digit x by 2, yielding [x : 2, x % 2].
    U    Upend; reverse each pair, yielding [x % 2, x : 2].
     F   Flatten the 2D list of binary digits.
      Ḅ  Convert from binary to integer.

Python 2, 26 bytes
lambda n:2*n-3*(4**n/3&n/2)

Bit tricks!
Say n has form ...ghfedcba in binary. Then, we can split it into every other bit as
n   = o + 2*e
n   = ...hgfedcba
o   = ...0g0e0c0a
2*e = ...h0f0d0b0

Then, the bit-switched result s can be expressed as s=2*o+e.
s   = 2*o + e
s   = ...ghefcdab
2*o = ...g0e0c0a0
e   = ...0h0f0d0b

We'd rather compute only one of e and o, so we express o=n-2*e and substitute
s=2*(n-2*e)+e = 2*n-3*e

So, now it remains to express e in terms of n. The number M=4**n/3 has form ...10101010101 in binary, which serves as a mask for the odd digits. The exponent n ensures that M is long enough. Taking the bitwise and of n/2 and this value gives e as desired.
n/2     = ...hgfedcb
M       = ...1010101
n/2 & M = ...h0f0d0b = e

We can instead express e in terms of o e=(n-o)/2, which gives s=(n+o*3)/2, which saves a byte thanks to an optimization from xsot.
lambda n:n+(n&4**n/3)*3>>1

Great explanation, and nice trick to use the mask only once by subtracting from n.  However, I prefer the opposite "odd" vs. "even" bit naming convention.  The LSB is bit 0, which is even (even though it's the first bit).  In SIMD programming, where shuffles often select elements with an index, the indices count from 0, so it's normal to consider the low element an even element.  e.g. [ 3 2 1 0 ]

I added a C answer using your expression.  All credit for the byte savings vs. Digital Trauma's C answer are due to this.

26: lambda n:n+(n&4**n/3)*3>>1

@PeterCordes Your C code works for me with gcc 4.8.3 and default settings. f(x){return x+((x&~0U/3)*3)>>1;} returns 1 for input 2.

@Dennis: Yeah, works for me in C, my bad.  I was actually testing the expression in calc (aka apcalc), not actually C.  I thought I'd be ok since I didn't need truncation to 32bit, or two's complement.  I didn't think the expression looked right, so I was willing to believe my wrong tests.  But anyway, I'm in need of a better REPL for developing bithacks.  Any suggestions?  (ideally Linux command line, like bc -l or calc, but actually exposing int32_t / uint32_t or something, not extended precision.)

@xsot Thanks! I remember you also this trick here.

C function, 38
Bit-twiddling:
f(x){return(x&~0U/3*2)/2+(x&~0U/3)*2;}

Ideone.

Or for the fun of it:
C recursive function, 43
As per the OEIS formula, a(4n+k) = 4a(n) + a(k), 0 <= k <= 3
f(x){return x>3?4*f(x/4)+f(x%4):x%3?3-x:x;}

or
f(x){return x>3?4*f(x/4)+f(x%4):x%2*2+x/2;}

Ideone.

xnor's clever transformation of the expression gets this down to 32 bytes in C.  I posted it as a separate answer, since it's a significantly different approach.

CJam, 16 14 13 bytes
ri4b4e!2=f=4b

Test it here.
Explanation
ri  e# Read input and convert to integer.
4b  e# Get base-4 digits.
4e! e# Push all permutations of [0 1 2 3].
2=  e# Select the third one which happens to be [0 2 1 3].
f=  e# For each base-4 digit select the value at that position in the previous
    e# list, which swaps 1s and 2s.
4b  e# Convert back from base 4.

That trick with the permutations is very good!

Pyth, 9 bytes
iXjQ4S2)4

Try it in the Pyth Compiler.
How it works
  jQ4      Convert the input (Q) to base 4.
 X   S2)   Translate [1, 2] to [2, 1].
i       4  COnvert from base 4 to integer.

JavaScript (ES6), 32 30 bytes
(n,m=0x55555555)=>n*2&~m|n/2&m

Only works up to 1073741823 due to the limitations of JavaScript's integers. 38 36 bytes works up to 4294967295:
(n,m=0x55555555)=>(n*2&~m|n/2&m)>>>0

Edit: Saved 2 bytes thanks to @user81655.
51 bytes works up to 4503599627370495:
n=>parseInt(n.toString(4).replace(/1|2/g,n=>3-n),4)

Could n<<1 be n*2?

@user81655 And I can use n/2 too! I don't know why I didn't think of those before.

I´ve never seen >>> ... what is that?

@Titus It's like >>> but it does an unsigned shift. >>>0 basically converts to a 32-bit unsigned integer.

x86 asm function: 14 bytes of machine code
uint64_t version: 24 bytes
x86-64 SysV calling convention (x in edi), but this same machine code will also work in 32bit mode.  (Where the lea will decode as lea eax, [edi + eax*2], which gives identical results).
0000000000000040 <onemask_even>:
  40:   89 f8                   mov    eax,edi
  42:   25 55 55 55 55          and    eax,0x55555555
  47:   29 c7                   sub    edi,eax
  49:   d1 ef                   shr    edi,1
  4b:   8d 04 47                lea    eax,[rdi+rax*2]
  4e:   c3                      ret
4f: <end>

0x4f - 0x40 = 14 bytes
This is compiler output from using xnor's excellent mask-once idea the opposite way.  (And opposite terminology: the low bit is bit 0, which is even, not odd.)
unsigned onemask_even(unsigned x) {
  unsigned emask = ~0U/3;
  unsigned e = (x & emask);
  return e*2 + ((x - e) >> 1);
}

I didn't find any improvements over what the compiler does.  I might have written it as mov eax, 0x555... / and eax, edi, but that's the same length.

The same function for 64bit integers takes 24 bytes (see the godbolt link).  I don't see any way shorter than 10-byte movabs rax, 0x55... to generate the mask in a register.  (x86's div instruction is clunky, so unsigned division of all-ones by 3 doesn't help.)
I did come up with a loop to generate the mask in rax, but it's 10 bytes (exactly the same length as the mov imm64).
# since 0x55 has its low bit set, shifting it out the top of RAX will set CF
0000000000000000 <swap_bitpairs64>:
   0:   31 c0                   xor    eax,eax      ; old garbage in rax could end the loop early
0000000000000002 <swap_bitpairs64.loop>:
   2:   48 c1 e0 08             shl    rax,0x8
   6:   b0 55                   mov    al,0x55      ; set the low byte
   8:   73 f8                   jnc    2 <swap_bitpairs64.loop>  ; loop until CF is set
000000000000000a <swap_bitpairs64.rest_of_function_as_normal>:
 # 10 bytes, same as   mov  rax, 0x5555555555555555
 # rax = 0x5555...
   a:   48 21 f8                and    rax,rdi
   ...

If we knew that none of the existing bytes in rax has their low bit set, we could skip the xor, and this would be 8 bytes long.
A previous version of this answer had a 10 byte loop using the loop insn, but it had a worst-case run-time of 0xFFFFFFFFFFFFFF08 iterations, because I only set cl.

Oasis, 17 bytes (non-competing)
n4÷axxn4÷xxe+3120

Try it online!
Oasis is a language designed by Adnan which is specialized in sequences.
Currently, this language can do recursion and closed form.
We use this formula: a(4n+k) = 4a(n) + a(k), 0 <= k <= 3
To specify the base case is simple: the 3120 at the end simply means that a(0)=0, a(1)=2, a(2)=1, a(3)=3.
n4÷axxn4÷xxe+3120
                0  a(0) = 0
               2   a(1) = 2
              1    a(2) = 1
             3     a(3) = 3

n                  push n (input)
 4÷                integer-divide by 4
   a               a(n/4)
    xx             double twice; multiply by 4
                   now we have 4a(n/4)
      n            push n (input)
       4÷xx        integer-divide by 4 and then multiply by 4
                   since there is no modulo currently, n%4
                   is built as n-(n/4*4)
           e       we should have done a(n-(n/4*4)), but this
                   is a shortcut for a(n-x) where x is the top
                   of stack. Therefore, we now have a(n-n/4*4)
                   which is a(n%4).
            +      add.

MATL, 10 bytes
BP2eP1ePXB

Try it online!
Modified version to generate the first terms of the sequence (OEIS A057300).
Explanation
B     % Take input implicitly. Convert to binary array
P     % Flip
2e    % Convert to two-row 2D array, padding with a trailing zero if needed.
      % Because of the previous flip, this really corresponds to a leading zero
P     % Flip each column. This corresponds to swapping the bits
1e    % Reshape into a row
P     % Flip, to undo the initial flipping
XB    % Convert from binary array to number. Display implicitly

zsh, 28 bytes
<<<$[`tr 12 21<<<$[[#4]$1]`]

Takes input as a command line argument, outputs on STDOUT.
It's not Bash-compatible because it uses zsh-specific base conversion syntax.
                       $1     input (first command line argument)
                 $[      ]    arithmetic expansion
                   [#4]       output in base 4
              <<<             pass the result of this to...
      tr                      the `tr' command
         12 21                and replace 1s with 2s, 2s with 1s
     `                    `   evaluate the result...
   $[                      ]  in another arithmetic expansion, to convert back
                                to base 10
<<<                           output the result on STDOUT

Retina, 70 bytes

.+
$*
+`(1+)\1
$1x
x1
1
^
x
r`(.)(.)
$2$1
1
x@
+`@x
x@@
x*(@*)
$.1
0$

Test suite. (Slightly modified.)
Well, just for fun: 7 bytes
T`12`21

Takes base-4 as input, and outputs as base-4.
Try it online!

I'm conflicted. I want to upvote the lower half of your answer, but downvote the upper half.

@Dennis Now I have those bits swapped.

05AB1E, 8 bytes
4B12Â‡4ö

Thanks to @Adnan for -5 bytes!
Uses CP-1252 encoding.
Try It Online!
Explanation:
4B       - Take input and convert to base 4.
  12Â    - Push 12 bifurcated.
     ‡   - Transliterate [1, 2] to [2, 1].
      4ö - Convert to base 10.

Nice, but you can replace 1 2‚2 1‚ with 12Â for 8 bytes.

Nice answer! Here an 8-byte alternative: 4в2‰íJJC

C, 32 30 29 bytes
f(x){return(x&~0U/3)*3+x>>1;}                // 30 bit version, see below

// less golfed:
f(x){return ((x & 0x55555555)*3 + x) >>1;}   //  >> is lower precedence than +

Algorithm copied from xsot's comment on xnor's Python answer.  Instead of masking both ways, mask one way and combine.
This compiles to the same asm as the last version I tested, and it works (for x up to 0x3FFFFFFF, and for x above that as long as bit 30 isn't set, see below).  In machine code, it's the same length as my existing asm answer.

The above version always clears the high bit of the result.  The best safe version is 32 bytes:
g(x){return 2*x-3*(x/2U&~0U/3);}   // safe 32bit version, works for all x

The Python version doesn't have this problem, because python uses arbitrary-precision integer types when needed, instead of truncating to a fixed upper limit.

@Dennis: Argh, yes, thanks.  I made that last change after testing, and missed the difference in asm output.  No wonder I was thinking it looked wrong; I had forgotten that >> was such low precedence.  I don't golf often enough to remember exactly what the rules are, since compiler warnings suggesting parens in dangerous cases save me in real code. :P

You can drop that space by rearranging the terms in the expression.

Javascript (ES6), 113 109 bytes
Saved 4 bytes thanks to Upgoat
n=>+('0b'+/(..)+$/.exec('0'+n.toString`2`)[0].split``.reduce((p,c)=>p.length-1?[p.join(c)]:[p[0],c],[''])[0],2)

How it works
n=>+('0b'+                              //parse as binary literal
    /(..)+$/.exec('0'+n.toString`2`)[0] //convert to binary string with an even number of digits
        .split``                        //convert to array
        .reduce((p,c)=>p.length-1?[p.join(c)]:[p[0],c],[''])
                                        //swap all numbers
)

use +('0b"+binary_string_here) instead of `parseInt(..., 2)

J, 20 bytes
4#.0 2 1 3{~4#.^:_1]

Usage
>> f =: 4#.0 2 1 3{~4#.^:_1]
>> f 85
<< 170

Where >> is STDIN and << is STDOUT.
Ungolfed
to_base   =: 4 #.^:_1 ]
transpose =: 0 2 1 3 {~ to_base
from_base =: 4 #. transpose

Three forks.
Sidenote
In the official interpreter, ^:_1 can be replaced by inv, saving 1 byte.
However, none of the online interpreters implement this.

C#, 44 bytes
Based on the C implementation
int f(int n)=>n>3?4*f(n/4)+f(n%4):n%2*2+n/2;

Try it here: C# pad

INTERCAL, 60 bytes
DOWRITEIN.1PLEASE.1<-!1~#21845'$.1~#43690DOREADOUT.1DOGIVEUP

Try it online!
Works for 16-bit integers, with I/O done in the most natural format for INTERCAL: the input is a series of decimal digits spelled out in one of several natural or constructed languages, and the output is in "butchered Roman numerals".
This is one of those rare challenges where INTERCAL's binary operators can actually be used at all intuitively, since repositioning bits is what they're all about. Select (~) takes the bits from its first argument corresponding to ones in its second argument and pads them to the right with zeroes, and mingle ($) interleaves the bits from its arguments such that the bits from the first argument are more significant. So the straightforward solution is to select out the less significant alternating bits (.1~#21845), select out the more significant alternating bits (.1~#43690), and interleave them back together in the opposite order. Fortunately for byte count, although INTERCAL's operators have no defined precedence (as the language's goal is to have no precedents), it turns out that the C-INTERCAL on TIO doesn't require much grouping for this particular expression, costing only one byte since '. can be abbreviated !.
With support for 32-bit integers:
INTERCAL, 67 bytes
DOWRITEIN:1PLEASE:1<-':1~#0$#65535'$:1~#65535$#0DOREADOUT:1DOGIVEUP

Try it online!
INTERCAL doesn't allow 32-bit literals, which actually makes this a bit easier to read, since it means the magic constants for selecting alternating bits have to be constructed by mingling two 16-bit literals together, where one's all zeroes and the other's all ones. (Actually, even if there were 32-bit literals, this would still be shorter. #0$#65535 is two bytes off #1431655765, and the same goes for the other one.) This communicates the whole process unnaturally well for INTERCAL.
An alternate approach with clumsy use of operand overloading:
INTERCAL, 71 bytes
DO:1<-:1/.2$.3PLEASEWRITEIN:2DO:1<-:2PLEASE:2<-.3$.2DOREADOUT:2DOGIVEUP

Try it online!
This does away with selecting altogether by declaring that :1 is .2 mingled with .3, setting :1 to the input, then outputting .3 mingled with .2. Since :1 was overloaded as .2$.3, DO :1 <- :2 assigns values to .2 and .3 such that :1 acquires the value of :2, which results in .2 containing the more significant alternating bits from :2 and .3 containing the less significant alternating bits. This would be the shorter of the two 32-bit solutions by four bytes if PLEASE WRITE IN :1 could replace PLEASE WRITE IN :2 DO :1 <- :2 with overloaded :1, but CALCULATING turns out to be necessary for using overloading. I also feel like there might be some shorter way to carry out the overloading itself than starting the program with DO:1<-:1/.2$.3, but since this is INTERCAL I also also feel like there can't be.

Husk, 8 bytes
ḋṁo↔‰2B4

Try it online!
Same as the Jelly solution.
Husk, 9 8 bytes
ḋṁ↔C_2Θḋ

Try it online!
General method.
-1 byte from Jo King. (using Θ)

Why is that a builtin?

Mathematica, 44 bytes
Fold[3#+##&,#~IntegerDigits~4/.{1->2,2->1}]&

Same approach as my CJam answer: convert to base-4, swap 1s and 2s, convert back. It also uses alephalpha's trick to replace FromDigits with a Fold operation to save one byte.

Actually, 16 bytes
4@¡"21""12"(t4@¿

Try it online!
Explanation:
4@¡"21""12"(t4@¿
4@¡               base 4 representation of n
   "21""12"(t     translate (swap 1s and 2s)
             4@¿  base 4 to decimal

J, 22 bytes
([:,_2|.\,&0)&.(|.@#:)

Alternative approach based on array manipulation instead of the base 4 trick.
Usage
   f =: ([:,_2|.\,&0)&.(|.@#:)
   (,.f"0) 0 1 9 85 220 1827 47525
    0     0
    1     2
    9     6
   85   170
  220   236
 1827  2835
47525 30298

Explanation
([:,_2|.\,&0)&.(|.@#:)  Input: n
                   #:   Get the value as a list of base 2 digits
                |.@     Reverse it
(           )&.         Apply to the list of base 2 digits
         ,&0            Append a zero to the end of the list
    _2  \               Split the list into nonoverlapping sublists of size 2
      |.                Reverse each sublist
 [:,                    Flatten the list of sublists into a list
             &.(    )   Apply the inverse of (reversed base 2 digits)
                        to convert back to a number and return it

REXX, 88 bytes
n=x2b(d2x(arg(1)))
o=0
do while n>''
  parse var n a+1 b+1 n
  o=o||b||a
  end
say x2d(b2x(o))

x86 machine code - 19 bytes
Callable function, input in ebx output in eax.
Lisitng :
    16                                  global tukar_bits
    17                                  tukar_bits:
    18
    19 00000016 89DA                    mov  edx, ebx
    20 00000018 8D0412                  lea  eax, [edx + edx]
    21 0000001B D1EA                    shr  edx, 1
    22 0000001D 81E255555555            and  edx, 0x55555555
    23 00000023 8D1452                  lea  edx, [edx + edx * 2]
    24 00000026 29D0                    sub  eax, edx
    25 00000028 C3                      ret

Try it online!, using x86-64 caller.

x86 machine code - 21 bytes
Callable function, input in ebxoutput in eax.
Listing :
     1                                  global tukar_bits
     2                                  tukar_bits:
     3
     4 00000000 89D8                    mov  eax, ebx
     5 00000002 89C2                    mov  edx, eax
     6 00000004 2555555555              and  eax, 0x55555555
     7 00000009 D1EA                    shr  edx, 1
     8 0000000B 81E255555555            and  edx, 0x55555555
     9 00000011 8D0442                  lea  eax, [edx + eax * 2]
    10 00000014 C3                      ret

Try it online!, using x86-64 caller.