Puzzle of the Week #205 - Formula

I have a sequence. It begins:

1

101

10101

1010101

101010101

etc

As it’s populated entirely with 1s and 0s it is not entirely clear whether these are decimal numbers, or binary numbers, or some other base entirely.

 

Construct a formula to give the nth term, which works no matter what base we are working in.

***EDIT*** You are looking for a simple formula where you plug in the value of n and get the nth term, no recursive formulae or finite sums required.