Sam invests $5,000 in an account that is compound continously at an annual interest rate of 7%, according to the formula A=Pe^rt, where A is the amount accrued, P is the principal, r is the rate of interest, and t is the time, in years. In 20 years, how much will Sam's investment be worth to the nearest dollar?

The formula for compound continuously is A = Pe^(rt), where A is the amount accrued, P is the principal, r is the rate of interest, and t is the time in years.

Given:
P = $5,000
r = 7% = 0.07
t = 20 years

Substituting the given values into the formula, we have:
A = 5000 * e^(0.07 * 20)

Using a calculator, we can calculate e^(0.07 * 20) to be approximately 2.8577.

A = 5000 * 2.8577
A ≈ $14,288.50

To the nearest dollar, Sam's investment will be worth $14,289 in 20 years. Answer: \boxed{14,289}.