If no obvious pattern occurs to me within a few minutes of inspection, I use this method to find a pattern.
Subtract the first term from each of the others: 2, 7, 18, 51 and call these terms T₁, T₂, T₃, T₄.
Create 4 equations to find 4 unknown coefficients a₁-a₄ using the equation Tᵣ=a₄r⁴+a₃r³+a₂r²+a₁r where r=1, 2, 3, 4.
2=a₄+a₃+a₂+a₁, (r=1)
7=16a₄+8a₃+4a₂+2a₁, (r=2)
18=81a₄+27a₃+9a₂+3a₁, (r=3)
51=256a₄+64a₃+16a₂+4a₁,. (r=4)
Now, using r as a multiplier, take the equation for r=1 and r for each of the other 3 equations, then subtract r×(equation 1) from the equations for other values of r:
7-4=16a₄+8a₃+4a₂+2a₁-2(a₄+a₃+a₂+a₁)⇒
3=14a₄+6a₃+2a₂,
12=78a₄+24a₃+6a₂, which can be reduced to 2=13a₄+4a₃+a₂,
43=252a₄+60a₃+12a₂.
We now have a system of 3 equations and 3 unknown coefficients.
We can eliminate a₂:
4=26a₄+8a₃+2a₂ minus
3=14a₄+6a₃+2a₂
1=12a₄+2a₃; and:
43=252a₄+60a₃+12a₂ minus
24=156a₄+48a₃+12a₂
19=96a₄+12a₃.
We now have 2 equations with 2 unknowns:
19=96a₄+12a₃
1=12a₄+2a₃⇒6=72a₄+12a₃
So, 13=24a₄, a₄=13/24.
1=13/2+2a₃, a₃=-11/4.
We can now find the remaining unknowns:
3=14(13/24)-6(11/4)+2a₂, a₂=143/24.
a₁=2-(13/24-11/4+143/24)=-11/4.
So now we have the formula to generate each term:
Tᵣ=a₄r⁴+a₃r³+a₂r²+a₁r=13r⁴/4-11r³/4+143r²/24-7r/4+1 and we plug in values of r from 0 to get:
1, 3, 8, 19, 52, 136, 313, 638, 1179, 2017, ...