Calculate power series result Related: Calculate Power Series Coefficients

Given a positive integer \$X\$ and a max exponent (Also a positive integer too) \$N\$ calculate the result of a power series. Example:

$$X^0+X^1+X^2+\cdots +X^N$$


Assume \$(X + N)  \le 100\$




Test Cases

1 2  =&gt; 3
2 3  =&gt; 15
3 4  =&gt; 121
2 19 =&gt; 1048575




Standard code-golf rules apply.
R, 25 bytes



function(x,n)sum(x^(0:n))


Try it online!