Hmmn - OK, I worked this out a little simpler. I'll use the same annotation as other answer for comparison/consistency.
X1=4
X2=6
X3=10
X4=16
X5=24
etc...
X = n*n+(4-n)
This then also provides you with the correct answer for X1 where n=1
- 1*1 + (4-1) = 1 + 3 = 4
- 2*2 +( 4-2) = 4+2 = 6
- 3*3 + (4-3) = 9 + 1 = 10
- 4*4 + (4-4) = 16
- 5*5 + (4-5) = 25 + -1 = 24
- 6*6 + (4-6) = 36 + -2 = 34
- 7*7 + (4-7) = 49 - 3 = 46