General term formula of sequence 1,5,7,17,31,65

General term formula of sequence 1,5,7,17,31,65

Because: 1 = the power of 2 - 1
5 = the square of 2 + 1
The third power of 7 = 2-1
The fourth power of 17 = 2 + 1
The fifth power of 31 = 2-1
So: the n-th power of the general term an = 2 + the n-th power of (- 1) (n = 1,2,3 ··)