Sum of all binomial coefficients

Problem: B(n) = Σₖ₌₀ⁿ C(n,k)

Give a non‑negative integer n. This page states the closed form of B(n), explains why it is true in mathematical English, and verifies it with a built‑in test harness.

Input

Constraints: n ∈ ℕ, typically n ≤ 1000 for display. All arithmetic uses exact BigInt.

Output

Answer
Closed form
B(n) = 2^n
Σ C(n,k)
Row length

Reason Why

Algebraic. The binomial theorem states (x + y)^n = Σₖ C(n,k) x^{n−k} y^k. Substituting x = y = 1 gives 2^n = Σₖ C(n,k). Hence B(n) = 2^n.
Combinatorial. Each term C(n,k) counts the k‑element subsets of an n‑set. Summing over all k counts every subset exactly once, so the total is the number of all subsets, namely 2^n.
Symmetry check. Because C(n,k) = C(n,n−k), the partial sums are pairwise matched; the extremes satisfy C(n,0)=C(n,n)=1.
Show coefficients C(n,k)

Check (harness)

Preloaded Checks (harness)

Each block recomputes B(n) two ways (Σ C(n,k) vs 2^n) and asserts they agree. One case is intentionally invalid.