What are the general formulas of 1,2,5,10,17,26 and 1,3,7,13,21?

What are the general formulas of 1,2,5,10,17,26 and 1,3,7,13,21?

1,2,5,10,17,26
an=n²-2n+2
1,3,7,13,21
an=n²-n+1