|
@@ -35,7 +35,7 @@ fn binom(n: Scalar, k: Scalar) -> Scalar =
|
|
|
falling_factorial(n, k) / k!
|
|
|
|
|
|
@name("Fibonacci numbers")
|
|
|
-@description("The nth Fibonacci number, where n is a nonnegative integer. The Fibonacci sequence is given by $F_0=0$, $F_1=1$, and $F_n=F_\{n-1\}+F_\{n-2\}$ for $n≥2$. The first several elements, starting with $n=0$, are $0, 1, 1, 2, 3, 5, 8, 13$.")
|
|
|
+@description("The nth Fibonacci number, where n is a nonnegative integer. The Fibonacci sequence is given by $F_0=0$, $F_1=1$, and $F_n=F_{{n-1}}+F_{{n-2}}$ for $n≥2$. The first several elements, starting with $n=0$, are $0, 1, 1, 2, 3, 5, 8, 13$.")
|
|
|
@url("https://en.wikipedia.org/wiki/Fibonacci_sequence")
|
|
|
@example("fibonacci(5)")
|
|
|
fn fibonacci(n: Scalar) -> Scalar =
|
|
@@ -47,7 +47,7 @@ fn fibonacci(n: Scalar) -> Scalar =
|
|
|
where phi = (1+sqrt(5))/2
|
|
|
|
|
|
@name("Lucas numbers")
|
|
|
-@description("The nth Lucas number, where n is a nonnegative integer. The Lucas sequence is given by $L_0=2$, $L_1=1$, and $L_n=L_\{n-1\}+L_\{n-2\}$ for $n≥2$. The first several elements, starting with $n=0$, are $2, 1, 3, 4, 7, 11, 18, 29$.")
|
|
|
+@description("The nth Lucas number, where n is a nonnegative integer. The Lucas sequence is given by $L_0=2$, $L_1=1$, and $L_n=L_{{n-1}}+L_{{n-2}}$ for $n≥2$. The first several elements, starting with $n=0$, are $2, 1, 3, 4, 7, 11, 18, 29$.")
|
|
|
@url("https://en.wikipedia.org/wiki/Lucas_number")
|
|
|
@example("lucas(5)")
|
|
|
fn lucas(n: Scalar) -> Scalar =
|
|
@@ -59,7 +59,7 @@ fn lucas(n: Scalar) -> Scalar =
|
|
|
where phi = (1+sqrt(5))/2
|
|
|
|
|
|
@name("Catalan numbers")
|
|
|
-@description("The nth Catalan number, where n is a nonnegative integer. The Catalan sequence is given by $C_n=\frac\{1\}\{n+1\}\binom\{2n\}\{n\}=\binom\{2n\}\{n\}-\binom\{2n\}\{n+1\}$. The first several elements, starting with $n=0$, are $1, 1, 2, 5, 14, 42, 132, 429$.")
|
|
|
+@description("The nth Catalan number, where n is a nonnegative integer. The Catalan sequence is given by $C_n=\frac{{1}}{{n+1}}\binom{{2n}}{{n}}=\binom{{2n}}{{n}}-\binom{{2n}}{{n+1}}$. The first several elements, starting with $n=0$, are $1, 1, 2, 5, 14, 42, 132, 429$.")
|
|
|
@url("https://en.wikipedia.org/wiki/Catalan_number")
|
|
|
@example("catalan(5)")
|
|
|
fn catalan(n: Scalar) -> Scalar =
|