The first term is 1 and each successive term is the sum of all the previous terms:
1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192
Although not true for the first term, each of the following terms has a value of 2n - 2
where n is the number of the term.
We want 2n - 2 >= 5000
log(2n - 2) >= log(5000)
(n - 2)log(2) >= log(5000)
n - 2 >= log(5000)/log(2)
n - 2 >= 12.29
n >= 14.29
So: n = 15