g | x | w | all
Bytes Lang Time Link
021APLNARS250925T081608ZRosario
00405AB1E250925T083150ZKevin Cr
028Google Sheets250924T165450Zdoubleun
015Charcoal250925T061551ZNeil
035Arturo250925T035741Zchunes
035C gcc250924T184956Zjdt
004Vyxal250925T001234Zlyxal
032JavaScript ES6250924T151802ZArnauld
006Dyalog APL250924T180912ZRubenVer
041Python250924T153233ZM--
021R250924T154235ZM--
009Uiua250924T145128Znyxbird

APL(NARS), 21 chars

{0=⍺:⍵⋄+/(⍺-1)∇¨0,⍳⍵}

Input left [⍺] the name of function as not negative integer, in the right the value [⍵] as not negative integer. Output one not negative integer.

Recursive function as the definition (test problem not okay only for 32 h 6) the problem I think is due to the recalculation of the function_0..n-1 result without store it.

Note that if ⍵=0, ⍳⍵ is ⍬ (the void set of numeric in APL) and 0,⍳⍵ is one array of 1 element: the 0. As this below show

  ⍬ 
┌0─┐
│ 0│
└~─┘
  0,⍳0
┌1─┐
│ 0│
└~─┘

test:

  h←{0=⍺:⍵⋄+/(⍺-1)∇¨0,⍳⍵}
  0 h 0
0
  99 h 0
0
  0 h 99
99
  9 h 10
92378
  2 h 0
0

05AB1E, 4 bytes

+I>c

Inputs in the order \$n,i\$.

Try it online or verify all test cases.

Explanation:

\$\binom{i+n}{i+1}\$

+     # Add the two (implicit) inputs together: n+i
 I    # Push the second input-integer again: i
  >   # Increase it by 1: i+1
   c  # Choose/nCr builtin: (n+i) choose (i+1)
      # (which is output implicitly as result)

Google Sheets, 28 bytes

=if(i*n,f(i-1,n)+f(i,n-1),n)

A named function that expects that its name is f and its arguments are i and n.

To use this as an anonymous function, add a lambda() wrapper (45 bytes):

lambda(f,i,n,if(i*n,f(f,i-1,n)+f(f,i,n-1),n))

To use the function in a formula without defining a named function, add let() (67 bytes when whitespace and n() removed):

=let(
  f, lambda(f, i, n,
    if(i * n,
       f(f, i - 1, n) + f(f, i, n - 1),
       n 
    )
  ),
  n(f(f, A1, B1))
)

screenshot

Uses Arnauld's pattern. Thanks to jdt for -5 bytes. Google Sheets limits recursion depth to 9999, and there are other computational limits as well, so the last two test cases [9,10] and [32,6] will error out.

Charcoal, 15 bytes

≔…·⁰NθI÷Π⁺θNΠ⊕θ

Try it online! Link is to verbose version of code. Explanation:

≔…·⁰Nθ

Input \$ i \$ and generate a range from \$ 0 \$ to \$ i \$ inclusive.

I÷Π⁺θNΠ⊕θ

Input \$ n \$ and calculate \$ \binom{i + n}{i + 1} = \frac{(i + n)!}{(n - 1)!(i + 1)!} = \frac{n \times (1 + n) \times \dots \times (i + n)}{1 \times 2 \times \dots \times (i + 1)} \$ .

Arturo, 35 bytes

f:$[i n][?0<i*n->+f i n-1f i-1n->n]

Try it!

Port of Arnauld's JavaScript answer.

C (gcc), 35 bytes

f(i,n){i=i&&n?f(i-1,n)+f(i,n-1):n;}

Try it online!

Simple port of Arnaulds answer.

Vyxal, 4 bytes

₌+›ƈ

Try it Online!

Boring nCr answer. Takes n then i.

Here's a more funny 2 byter:

Vyxal RG, 2 bytes

Try it Online!

Takes i then n

Explained

₌+›ƈ­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
₌+    # ‎⁡(i + n)
   ƈ  # ‎⁢choose
₌ ›   # ‎⁣(i + 1)
💎

Created with the help of Luminespire.

or

(¦­⁡​‎‎⁡⁠⁡‏⁠⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‏​⁢⁠⁡‌⁤​‎‏​⁢⁠⁡‌­
(   # ‎⁡i times:
 ¦  # ‎⁢  Get the cumulative sum of the top of the stack, initially n.
# ‎⁣The R flag makes sure that the initial cumulative sum casts n to range(1, n) instead of summing the digits of n
# ‎⁤The G flag outputs the greatest value of the top of the stack, defaulting to the top of the stack if it's still a number (i.e. i = 0)
💎

Created with the help of Luminespire.

JavaScript (ES6), 32 bytes

-6 thanks to jdt
-1 thanks to doubleunary

f=(i,n)=>i*n?f(i-1,n)+f(i,n-1):n

Try it online!

Dyalog APL, 6 bytes

+!⍨1+⊣

Explanation: \$\binom{n + i}{i + 1}\$

Python, 44 43 41* bytes

lambda i,n:math.comb(n+i,i+1);import math

Attempt This Online!

Thanks to Toby Speight for saving 1 byte and Albert.Lang for saving 2 additional bytes.

R, 21 bytes

\(i,n)choose(n+i,i+1)

Attempt This Online!

Uiua, 9 bytes

-3 thanks to fmbalbuena!

⍣⊣0⍥\+⊙⇡₁

pad

⊙⇡₁  # get range from 1 to n
⍥\+  # get prefix sums i times
⍣⊣0  # take last (defaulting to zero)