| Bytes | Lang | Time | Link |
|---|---|---|---|
| 049 | Bespoke | 250808T043043Z | Josiah W |
| 028 | Setanta | 250807T183439Z | bb94 |
| 008 | AWK | 250807T182806Z | xrs |
| 003 | ><> | 170226T110801Z | PidgeyUs |
| 008 | Zsh | 230710T103020Z | roblogic |
| 018 | brainfuck | 230707T091414Z | l4m2 |
| 008 | Juby | 230707T034431Z | Jordan |
| 008 | Haskell | 230707T030604Z | Yelp |
| 031 | Acc!! | 230706T185520Z | DLosc |
| 004 | √ å ı ¥ ® Ï Ø ¿ | 170401T121050Z | caird co |
| 002 | Vyxal HṪ | 230706T155350Z | The Empt |
| 001 | Thunno 2 | 230608T165552Z | The Thon |
| 003 | Braingolf | 170523T102800Z | Mayube |
| 003 | J | 220219T075356Z | sinvec |
| 002 | HBL | 211125T200234Z | DLosc |
| 001 | MATL | 170213T023211Z | Suever |
| 009 | Google Sheets | 200820T144022Z | General |
| 004 | MAWP | 200820T040659Z | Razetime |
| 006 | 1+ | 200820T042602Z | Twilight |
| 012 | Flurry | 200820T035939Z | Bubbler |
| 056 | naz | 200126T080449Z | sporebal |
| 003 | GolfScript | 200126T085608Z | user8505 |
| 005 | Keg | 190914T131052Z | user8505 |
| 002 | x86 opcode | 171216T082811Z | l4m2 |
| 002 | Jelly | 170213T162837Z | user6318 |
| 007 | Hexagony | 171121T072612Z | boboquac |
| 002 | Implicit | 171116T033145Z | MD XF |
| 006 | Aceto | 171118T162214Z | qqq |
| 008 | Perl 5 | 170916T012831Z | Xcali |
| 017 | Windows batch | 170227T102548Z | stevefes |
| 013 | Excel VBA | 170709T151128Z | Taylor R |
| 023 | Underload | 170619T155820Z | Madison |
| 035 | MarioLANG | 170528T073947Z | user6933 |
| 009 | Aceto | 170523T101248Z | L3viatha |
| 003 | Japt | 170523T100844Z | Shaggy |
| 028 | c++ | 170405T134103Z | jdt |
| 017 | Python | 170302T155951Z | iwaseate |
| 009 | Haskell | 170401T032440Z | Generic |
| 010 | /// | 170226T052344Z | boboquac |
| 013 | Melang Non competing | 170307T163338Z | user6318 |
| 002 | Milky Way | 170228T170120Z | user6318 |
| 004 | APL 4 Bytes | 170301T230501Z | Antisthe |
| 022 | PHP | 170301T020926Z | Titus |
| 007 | Cardinal | 170228T145646Z | fəˈnɛtɪk |
| 033 | ForceLang | 170226T121620Z | SuperJed |
| 044 | Java | 170226T120351Z | user6333 |
| 013 | C gcc | 170226T094824Z | Ahemone |
| 018 | C | 170226T084832Z | Albert R |
| 015 | Powershell | 170213T115742Z | colsw |
| 002 | Brachylog | 170213T090133Z | Fatalize |
| 003 | Clack | 170216T024323Z | Socratic |
| 001 | RProgN | 170213T014109Z | ATaco |
| 022 | SQLite | 170214T145551Z | Business |
| 008 | Cubix | 170213T152102Z | Luke |
| 011 | Hexagony | 170214T175311Z | Riley |
| 026 | Scala | 170214T174715Z | Michal |
| 006 | Labyrinth | 170214T173234Z | SnoringF |
| 010 | Java OpenJDK 9 | 170213T062305Z | Pavel |
| 002 | Chaincode | 170214T093125Z | Linnea G |
| 1317 | PHP | 170213T102242Z | mleko |
| 011 | Cheddar | 170214T043957Z | Pavel |
| 004 | Beam | 170213T224846Z | MickyT |
| 011 | Clojure | 170213T222129Z | Carcigen |
| 003 | TIBasic | 170213T030507Z | Timtech |
| 005 | Forth | 170213T220129Z | Koppany |
| 010 | Javascript | 170213T215916Z | Malivil |
| 005 | dc | 170213T211757Z | Mitchell |
| 004 | O | 170213T210813Z | MickyT |
| 012 | brainfuck | 170213T202735Z | mbomb007 |
| 012 | Javascript | 170213T110705Z | svarog |
| 008 | BrainFlak | 170213T025710Z | DJMcMayh |
| 003 | CJam | 170213T164243Z | Business |
| 013 | Python | 170213T020506Z | xnor |
| 003 | MATLAB / Octave | 170213T031026Z | Suever |
| 004 | Perl 6 | 170213T131855Z | smls |
| 008 | QBIC | 170213T120703Z | steenber |
| 019 | C | 170213T074339Z | Abel Tom |
| 010 | Javascript ES6 | 170213T095915Z | user6403 |
| 001 | Pyke | 170213T104443Z | Blue |
| 098 | Ruby | 170213T094220Z | G B |
| 017 | PHP | 170213T095605Z | aross |
| 001 | 05AB1E | 170213T093153Z | Okx |
| 013 | R | 170213T064832Z | Rudier |
| 025 | Lua | 170213T092244Z | IDid |
| 032 | C# | 170213T090018Z | Mika |
| 003 | Carrot | 170213T084312Z | user4180 |
| 019 | PHP | 170213T055925Z | user6395 |
| 003 | Vim | 170213T030640Z | DJMcMayh |
| 003 | Retina | 170213T025906Z | user6213 |
| 005 | Mathematica | 170213T025148Z | Greg Mar |
| 1117 | Billiards | 170213T020831Z | hyperneu |
| 012 | Turtlèd | 170213T021031Z | Destruct |
| 004 | SmileBASIC | 170213T015222Z | 12Me21 |
Setanta, 29 28 bytes
Thanks to General Grievance for −1 byte
gniomh(a,b){toradh a==b|0&1}
Returns 1 if the arguments are equal; 0 otherwise.
><>, 3 bytes
Also see this post, but ><> needs the explicit print and termination so we can't go under 3 bytes.
=n;
But this is a pretty boring solution. There are two 5 byte solutions
1nnn;
and
1++n;
that are only slightly more interesting. For input a and b, the first one works by printing 1ba and the second by printing a+b+1.
Here is a TIO test bench where bytes 2-5 should be replaced by the first 4 bytes of a solution.
Acc!!, 31 bytes
Count i while N-10 {
Write 57
}
Takes the two numbers space-separated. Try it online!
Explanation
Count i while N-10 { # While input character is not a newline:
Write 57 # Output 9
}
To prove that the output is always valid, consider the following numbers:
- A + B = the sum of the input numbers
- AB = the concatenation of the input numbers (equal to A * 10 ^ (len B) + B)
- N = a number of the same length as AB but composed of all 9's
- N+ = N with an extra 9 concatenated (equal to N * 10 + 9)
The output of this program is N+ (the extra 9 comes from the space between the input numbers). Looking at the formulas, we have A + B <= AB, AB <= N, and N < N+; therefore, this program's output is always greater than (and therefore not equal to) A + B.
√ å ı ¥ ® Ï Ø ¿, 4 bytes
II1_
II Take 2 inputs and push to the stack
1 Push 1 to the stack
_ Push the sum of the stack
To output, add o to the end.
Vyxal HṪ, 2 bytes
□∑
I had to post this as it is quite obfuscated.
Explanation
□∑
□ # Get input treated as a list separated by newlines.
∑ # Sum the list together.
💎 Created with the help of Luminespire at https://vyxal.github.io/Luminespire
With the explanation above, it seems like that this returns the correct sum. But if you think this, then you haven’t paid attention to the flags.
HṪ
H # Before execution, push 100 to the stack.
Ṫ # After execution, take the sum of the whole stack and print it.
💎 Created with the help of Luminespire at https://vyxal.github.io/Luminespire
Now that you have the full picture, you realise that it adds 100 to the result.
Braingolf, 3 bytes
g1+
Appends the inputs to eachother (ie 17, 4 becomes 174), then increments by 1.
Notable testcases:
[0, 0] becomes 00, becomes 01
[0, 1] becomes 01, becomes 02
[1, 0] becomes 10, becomes 11
[1, 1] becomes 11, becomes 12
MATL, et al. 1 byte
=
Accepts two natural numbers as inputs and compares them. If they are equal, the output is 1 and if they not equal the output is 0. This is the same approach as @ATaco's solution.
Google Sheets, 9
=--(A1=A2
- If A1=A2, the sum is even, but the output is always 1, which is odd.
- If A1<>A2, then the sum is positive, but the output is always 0, which is not positive.
Why didn't I use =A1+A2+1? Because if I input a sufficiently large number and 0, the +1 does nothing.
Flurry, 12 bytes
[]{<{}{}>}{}
Run example
$ printf "0 0" | ./flurry -nib -c "[]{<{}{}>}{}"
73728
$ printf "0 1" | ./flurry -nib -c "[]{<{}{}>}{}"
75264
$ printf "0 11" | ./flurry -nib -c "[]{<{}{}>}{}"
3687936
Takes two numbers separated by single space from stdin in binary mode, and prints the return value as an integer.
The binary mode is the trick here. What the program does is to implicitly push all codepoints of stdin to the stack, and print the product of the entire stack.
Code explanation
// Pop (stack height + 1) times and compute the product;
// popping from empty stack gives I = 1
// [] {<{}{}>} {}
main = height times-pop pop
// { <{} {} >}
times-pop = \x. x ∘ pop
Proof that this does not give a+b for any a b
Base case: The input of "0 0" gives 48 × 32 × 48 = 73728.
Inductive case:
- The codepoint of any printable ASCII is 32 or above, so adding a digit (which amplifies
a+bby at most 10) amplifies the output by 32 or above. - Adding 1 to an existing digit adds the product of all the codepoints except itself to the output, which is much greater than the digit value of the modified digit.
Therefore, the output grows much faster than the value of a+b, and they can never be equal.
For comparison, here is the program that computes a+b+1:
Flurry, 18 bytes
{}(<><<>()>)[{}{}]
$ ./flurry -nin -c "{}(<><<>()>)[{}{}]" 12 13
26
$ ./flurry -nin -c "{}(<><<>()>)[{}{}]" 0 0
1
$ ./flurry -nin -c "{}(<><<>()>)[{}{}]" 0 10
11
// initial stack = a b
// {} (<><<>()>) [{} {} ]
main = pop (push succ) (pop pop)
// b succ a
= b succ (succ a)
= b + succ a = a + b + 1
naz, 56 bytes
6a8m2x1v1x1f1r3x1v2e0m1o0x1x2f2r3x1v3e0m1o0x1x3f1a1o0x1f
Takes two natural numbers as input, separated by a space.
Explanation (with 0x commands removed)
6a8m2x1v # Set variable 1 equal to 48 ("0")
1x1f1r3x1v2e0m1o # Function 1
# Read the first byte of input, removing it from the input string
# Jump to function 2 if it equals variable 1
# Otherwise, output 0
1x2f2r3x1v3e0m1o # Function 2
# Read the second byte that's still in the input string
# Jump to function 3 if it equals variable 1
# Otherwise, output 0
1x3f1a1o # Function 3
# Output 1
1f # Call function 1
GolfScript, 3 bytes
Input is to be taken as two separate lines. In GolfScript, a preceding 0 is allowed for numbers.
n/0
Explanation
# Two inputs taken with newlines
n/ # Split the input (separated by newlines) with newlines
0 # Add a 0 to prevent a preceding 0
# Implicit concatenation
GolfScript, 3 bytes
~+)
Explanation
~ # Evaluate the input
+ # Add the two numbers
) # Increment the sum
Keg, 5 bytes
Input two natural numbers separated with spaces.
?(+).
Sums the whole stack. The answer is guaranteed to be invalid, since what it sums is the charcodes of the numbers.
x86 opcode, 2 bytes
INC EDX
RET
input EAX and EDX, output EDX:EAX If D':A=D+A then D has to be zero, making the equation still not correct
x86 opcode __cdecl, 3 Bytes
MOV DL, 3
RET
Hexagony, 7 bytes
?<.!?)@
Or in more readable format,
? <
. ! ?
) @
This beats the current Hexagony solution of 11 bytes.
Explanation:
If the first number is not 0, the program takes the following path:
This reads the first number and branches right. Then it reads the second number, followed by wrapping and trying to read a third, but that doesn't exist so it reads 0. This is printed and the program terminated (note that if a>0, since b is non-negative a+b>0).
If the first number is 0, the program takes the following path to start with:
This reads the first number and branches left. It hits the corner, taking the route from along the north-west edge because the number is 0, and reads the second number. It wraps, then increments the second number and prints.
It bounces against the <, printing the incremented second input again. It increments the value and takes the north-east edge again, but this time because the current edge a twice-incremented non-negative value which is definitely positive. It then tries to get a third input, but receives 0 instead.
Finally it wraps and gets diverted by the arrow, then tries to read a fourth input and gets 0 again. It wraps and tries to read a fifth input and receives 0 for the last time. This it prints, and wraps to the @ and exits.
Note that b*(10^k+1)*10>0+b=b where k is the length of b in digits, so this works.
Implicit, 2 bytes
+.
+. implicit input of two integers
+ add them
. and increment
= also works for 1 byte, but I added that to the existing list of =s.
Aceto, 6 bytes
rrJiIp
r reads input and puts on stack (x2) J concatenates top 2 values i makes it an integer I increments it p prints it
Windows batch, 24 23 17 bytes
@cmd/cset/a%1+%21
Test cases:
Tested on Win10 64-bit
Foo\Bar\Baz>NotCalc.bat 1 55
552
Note: batch files are limited to 32-bit signed integer!
Excel VBA, 13 Bytes
Anonymous VBE immediate window function that takes input from range [A1:B1] (... or really any range that is a subset of [1:1], I suppose) and outputs their sum +7
?[Sum(1:1)+7]
Underload, 23 bytes
((::)~*)~(~)~*a*^*(**)*
Takes input in the form of Church numerals on the stack and outputs to the stack.
MarioLANG, 35 bytes
;
)
;
>[!(+:
"=#===
) -
+ (
! <
#="
Reads two inputs and puts them in differents cells (variables). Increments one and decrements the other until the second number is zero. Then adds one calculate the wrong answer.
Aceto, 9 bytes
ir+1
ri+p
Super straightforward. Prints the sum of the two inputs and 1. If I can assume for the inputs to be on the stack already, there's a 5-byte solution:
1+
+p
Japt, 3 bytes
NxÄ
Explanation
N :The array of all inputs
x :Sum the array
Ä :Add one to each element
Python, 25 17 bytes
Takes an array of numbers n, and returns their sum + 1:
lambda n:sum(n,1)
I just translated https://codegolf.stackexchange.com/a/111845/66068 into python.
Haskell, 11 9 bytes
(succ.).(+)
Adds together and then adds 1
EDIT: Of course, if you want to go with the boring answer:
a#b=a+b+1
is 9 bytes.
///, 10 bytes + input
/0/1//+//[input A]+[input B]
Obviously [input A] and [input B] are supposed to be replaced with the appropriate inputs
Changes 0's to 1's, then concatenates the strings.
This works because:
- For A,B>0, join(A,B)>A+B
- join(A,B)>join(C,D) if A>C or B>D
- The function f(x)='change 0's to 1's in the digits of x' is always at least x
So we have join(f(A),f(B))>f(A)+f(B)>=A+B.
And if one or both of the inputs are 0, we have join(1,B)>1+B>0+B, join(A,1)>A+1>A+0 and join(1,1)=11>0+0.
Note 1: This type of input has been approved by the community
Note 2: This output doesn't give leading 0's either
Note 3: Less bytes than Python, PHP, C#, C, Powershell and more!
Melang (Non competing) 13 bytes
\n\n+\n+\n\ni
I wrote Melang for this challenge and decided that it works so might as well bring it here.
Adds the numbers inputted together and adds one. For more on the language and to try it out visit here.
Milky Way 2 bytes
b!
Checks equality.
http://meta.codegolf.stackexchange.com/a/8493/63187 allows me to assume the inputs are pushed to stack.
Thank you Zach Gates! I out golfed him in his own language :P
APL - 4 Bytes
1++/
Takes array, sums its elements and adds one. Test:
1++/1 2
4
1++/1 0
2
PHP, 22 bytes
eval("echo $argn+1;");
A port of ConnorLSW´s answer. Run with echo "<a>+<b>" | php -R '<code>'.
ForceLang, 33 bytes
def a io.readnum()
io.write a+a+1
Java - 44 bytes
int n(int a,int b){return Math.abs(a+(-b));}
Returns an absolute value of a + (-b)
Ungolfed version:
int n(int a, int b) {
return Math.abs(a + (-b));
}
C (gcc), 13 bytes
n(a,b){a=&b;}
returns b's address in memory, though it's slighty cheaty since the user is able to predict the address of b.
Powershell, 15 Bytes
("$args"|iex)+1
input is in any standard mathematical format, 1+1,2+2,5123-123213,200*99,1234/555 etc.
Just takes input, invokes (calculates) it, then adds one at the end.
Brachylog, 2 bytes
+<
Explanation
+ The sum of the elements in the Input...
< ...is strictly less than the Output
(implicitely label the output with an integer respecting this constraint)
This will always result in A+B+1, if Input = [A, B].
Clack, 3 bytes
1++
Since clack has very few instructions at the moment, the shortest method is to just push 1, the two numbers, and add them.
RProgN, 4 3 1 Byte
E
The most simple of solutions, compares if A and B are equal. Pushes true, which RProgN sees as 1, if they are the same, or false aka 0 otherwise.
Test Cases
0+0 = 1
1+0 = 0
0+1 = 0
1+1 = 1
SQLite, 23 22 bytes
Saved 1 byte thanks to MickyT
select 1+sum(v)from i;
By default, SQL variants can take input from a named table. In this case it takes two numbers from the column v in the table i, sums them, and adds 1.
Cubix, 9 8 bytes
u-~OII/@
Explanation
Expanded, this answer looks like this:
u -
~ O
I I / @ . . . .
. . . . . . . .
. .
. .
The order of the instructions that are executed is II~-O@
II~-O@
I # First input
- # Minus
I~ # NOT(second input)
O # Output as integer
@ # End program
Tested for all combinations of inputs where both are in the range 0-100.
Try it here.
Hexagony, 11 bytes
?}?@!<."+)/
Prints X + Y + 1
The expanded Hex:
? } ?
@ ! < .
" + ) / .
. . . .
. . .
- read into the initial memory edge.
- go forward to the right and read into that one.
- wrap around to the middle row.
- go backward to the left and sum the other edges into this one.
- increment.
- redirect NW then W to save a byte.
- print and exit.
Scala, 26 Bytes
var n=(a:Int,b:Int)=>a+b+1
PHP, 13 bytes; (17 REPL-less)
!max($argv)+0
Examples
[0,0] -> 1
[0,1] -> 0
[1,0] -> 0
For those without REPL use
<?=!max($argv)+0;
and run using
echo '<?=!max($argv)+0;' | php -- 0 0
Beam, 4 bytes
This seems a bit cheaty, but it reads from the input (characters only) and outputs the ASCII values for each.
>r:!
> # redirect right
r # read input character
: # output numeric value of beam
! # if beam <> 0 reflect back
The Halt command is required on here as the beam just disappears into the aether.
Clojure, 11 bytes
#(+ % %2 1)
Unoriginal. Just adds 1 to the sum of % and %2 (the arguments to the function).
TI-Basic, 3 bytes
not(max(Ans
Alternative solutions:
10^(sum(Ans 3 bytes @DestructibleWatermelon
not(sum(Ans 3 bytes
1+sum(Ans 4 bytes
Input :X=Y 5 bytes @ATaco
Input :X+not(Y 6 bytes
Input :not(X+Y 6 bytes
Input :10^(X+Y 6 bytes
Input :X+Y+1 7 bytes
Input :not(max(X,Y 7 bytes
Ans(1)=Ans(2 8 bytes
Ans(1)+not(Ans(2 9 bytes
not(Ans(1)+Ans(2 9 bytes
It's interesting that you made the question's examples in TI-Basic, but you forgot the shorter A=B (or maybe it was up to us to find out?)
Forth, 5 bytes
I didn't see Forth on the list, this is the A+B+1 solution.
+ 1 +
It adds the top 2 numbers on the stack, then adds one to it.
The answer will be the top value on the stack.
Example:
=> 4, 5
+ 1 +
=> 10
Javascript, 10 bytes
x=>y=>!x+y
Takes 2 numbers using currying syntax like so:
(x=>y=>!x+y)(0)(0) // 1
dc, 5 bytes
?1n+n
Input: Two natural numbers separated by a space on stdin.
Output: The digit 1 immediately followed by the sum of the two numbers, which is a number larger than the sum of the two numbers.
Example:
Input: 222 333
Output: 1555
O, 4 bytes
jj=o
The same as other implementations. Get the numbers, test the equality and output. Try it here
j Number input
j Number input
= Equal to
o Print object
Javascript, 12 bytes
(a,b)=>a+b+1
Accepts 2 numbers inside a closed lambda and return their sum plus 1
Example:
((a,b)=>a+b+1)(1, 2)
// 4
Brain-Flak, 8 bytes
({}{}())
This is the most readable brain-flak answer I have ever written. :)
Explanation:
( ) # Push the sum of all the following:
{} # The first input
{} # The second input
() # and one
Alternate solutions (also 8 bytes):
({}[]{}) # Sum + 1
([]{}{}) # Sum + 2
There's a bunch of other solutions that only work with positive numbers:
(<{}>{})
({}<{}>)
({{}}())
({{}()})
({{}}[])
({{}[]})
CJam, four 3 bytes
q~=
Explanation
q~ e# Read the input and eval it (pushes the numbers on the stack).
= e# Check equality.
Python, 13 bytes
[(0,0)].count
Try it online! Takes input as a tuple.
Using an object method for the function avoids the boilerplate of a lambda.
lambda a,b:a-~b # 15 bytes
Here, the idea is to map (0,0) to 1 and everything else to 0. Since only 0+0 gives a sum of 0 among natural numbers, that always avoids matching the sum.
If one could output a Boolean here, which I find shady, a byte could be saved as
(0,0).__ge__
This checks if the input tuple is at most (0,0), which is only true for (0,0). In Python, True==1 and False==0. Even more shadily, outputting via exit code and treating that as a Python Boolen would save two bytes:
[(0,0)].pop
If string I/O is allowed and leading zeroes are OK, there's the 8-byte solution
'1'.join
This concatenates a1b, which is always bigger than a+b.
MATLAB / Octave, 3 bytes
@eq
Accepts two inputs and checks for equality and yields 1 if they are equal and 0 otherwise.
Perl 6, 4 bytes
!*+*
A lambda (formed by Whatever-currying), that adds the boolean inverse (1 or 0) of the first argument to the second argument.
QBIC, 8 bytes
a bit uninteresting:
::?a+b+1
This just takes A and B from the cmd-line, adds them plus 1.
C 26 24 19 bytes
f(c,d){return!c+d;}
Ungolfed version:
int f(int c,int d)
{
return !c+d;
}
I hope I got the specification right. Can definitely be shortened!?
@Pavel Thanks for saving 2 bytes
@Neil Thanks for your input.
Javascript (ES6), 10 Bytes
x=>y=>!x+y
Put f= before the code and run like f(x)(y).
This will output y plus either 0 or 1 depending on whether x is truthy or falsy, respectively.
Thanks to TomDevs for the bytes saved
Pyke, 1 byte
q
This is the only 1 byte solution that works in Pyke, all the others have collisions.
Ruby, 9 bytes (8 + -n flag)
p~/1/||1
Input 2 integers separated by comma or space or semicolon or just whatever.
Explanation:
If the input string does not contain any '1', output '1' (since the sum can't be one).
If the input string is 3 characters long, the position of the first one can be 0 or 2, the sum can't be zero, and only '1 1' has sum two (but the first '1' is at position zero).
If the input string is longer, we don't care, the sum will be bigger than one and bigger than the position of the first '1'.
PHP, 17 bytes
<?=1-join($argv);
Run like this:
echo '<?=1-join($argv);' | php -- 0 0
> 1
Explanation
This just concatenates the arguments. The first argument (script name) contains -. So that results in a negative number, which I negate with the minus sign. Then I add 1, just in case the first input number is a 0 (0123 = 123).
05AB1E, 1 byte
Q
Works the same as the RProgN answer.
Checks if a and b are the same. If so, print 1. Otherwise, print 0
R, 13 bytes
sum(scan()+1)
Thanks to Jonathan Allan for his inputs !
C#, 32 bytes
Golfed
int i(int x,int y){return++x+y;}
Ungolfed
int i (int x, int y)
{
return ++x+y; //Returns X+Y+1
}
Carrot, 3 bytes
1$$
(input is newline separated)
Similar to ais529's answer, except this takes care of leading zeroes. This outputs 1 concatenated with both the input numbers. So 5\n6 outputs 156.
Alternate solutions:
6 bytes
1$$^*1
Same thing as the above solution, but concatenates it with a copy of itself. So 5\n6 becomes 156 which then becomes 156156.
8 bytes
#^A +1+
(note the trailing space, the input is space separated this time)
#^A +1+
#^ //gets all of the input
A //convert it an array splitting on spaces
+1 //add 1 to each of the array's elements
+ //sums up all the elements in the array
PHP, 19 bytes
1<?=max([0]+$argv);
Vim, 3 bytes/keystrokes
<C-a>gJ
Note that <C-a> is actually ctrl-a, which represents byte 0x01.
I love it when vim (which isn't even a programming language) can compete with golfing languages. :) Input comes in this format:
a
b
This simply increments the first number by one (This is the <C-a> part) and then joins the string representations of the two numbers together. As far as I can tell, this should never result in the sum.
Retina, 3 bytes
1
(The first line has a space before the newline. Stack Exchange isn't very good at showing trailing whitespace.)
Input is the numbers in decimal, separated by a space (e.g. 12 34). This program just changes the space to a 1, creating a number too large to be the sum of the input numbers (it necessarily has at least 2 more digits than either, and adding two numbers produces an output with no more than 1 digit more than the larger input).
Mathematica, 5 bytes
1+##&
Outputs the sum of the two arguments plus 1. For example, 1+##&[2,5] yields 8.
(Side note: Binomial almost works, although Binomial[1,0]=1 and Binomial[4,2]=6 are counterexamples; I think they're the only counterexamples, though.)
Billiards, 11 characters = 17 bytes
⇲
⇲
+
1
+
↥
Implements x + y + 1. Pretty elementary. It takes the inputs on two separate lines. (By the way, the language was modified slightly after the challenge, but only to suppress the prompt from inputting, not sure if this answer is still valid).
7 characters = 11 bytes, non-competing
This one is shorter but only possible after a new update of the language:
⇲
⇲
=
$
This uses x == y, which was shamelessly stolen from @ATaco's RProgN solution [ hope you don't mind (: ]. The $, on exit, outputs how many balls passed over it.
Turtlèd, 12 bytes
makes very large numbers
'1?:?:[1'0l]
Try it online!
Explanation:
'1 write one on the starting grid square
?:?: take a number, move right that many (repeat)
[1 ] while not on a grid square with a one on it
'0l put a zero on that square, move left
[implicit output of grid]
It thus outputs 10**(x+y).
SmileBASIC, 4 bytes
!A+B
not(A)+B
1+1=2 -> !1+1 -> 0+1=1
0+1=1 -> !0+1 -> 1+1=2



