f(n) = 3n + 5 is Theta(n): it is O(n), never more than a constant times n past some n0, and Omega(n), never less than a constant times n. The rows below f are the two references, 1 x n and 4 x n. Where f sits between them, both bounds hold.
Bounds table for f of n equals 3n plus 5 against n and 4n.
n = 1: f = 8, between n = 1 and 4n = 4? The lower bound holds, 8 >= 1. The upper bound fails, 8 > 4: the constant 5 still dominates. Big O only promises the bound for large n.
n 1: f 8, upper bound fails.
n = 2: f = 11, between n = 2 and 4n = 8? The lower bound holds, 11 >= 2. The upper bound fails, 11 > 8: the constant 5 still dominates. Big O only promises the bound for large n.
n 2: f 11, upper bound fails.
n = 3: f = 14, between n = 3 and 4n = 12? The lower bound holds, 14 >= 3. The upper bound fails, 14 > 12: the constant 5 still dominates. Big O only promises the bound for large n.
n 3: f 14, upper bound fails.
n = 4: f = 17, between n = 4 and 4n = 16? The lower bound holds, 17 >= 4. The upper bound fails, 17 > 16: the constant 5 still dominates. Big O only promises the bound for large n.
n 4: f 17, upper bound fails.
n = 5: f = 20, between n = 5 and 4n = 20? The lower bound holds, 20 >= 5. The upper bound holds too, 20 <= 20, for the first time: n0 = 5.
n 5: f 20, upper bound holds.
n = 6: f = 23, between n = 6 and 4n = 24? The lower bound holds, 23 >= 6. The upper bound holds too, 23 <= 24.
n 6: f 23, upper bound holds.
n = 7: f = 26, between n = 7 and 4n = 28? The lower bound holds, 26 >= 7. The upper bound holds too, 26 <= 28.
n 7: f 26, upper bound holds.
n = 8: f = 29, between n = 8 and 4n = 32? The lower bound holds, 29 >= 8. The upper bound holds too, 29 <= 32.
n 8: f 29, upper bound holds.
From n = 5 onward, n <= f(n) <= 4n, so f is Theta(n). The lower reference makes it Omega(n), the upper makes it O(n), and the small n where the bound fails do not matter: the definitions only speak about n beyond some n0.
f is Theta of n from n0 equals 5.