Since a(0) = 0, we have a recursive expression. Namely a(n) = 2*a(n-1) + 1. old comment from 2009 due to Jaroslav Krizek. See oeis.org/A000225 we do this.