# Finding an equation for a pattern

I am trying to figure out how to form an equation for the total number of tiles in Figure "N." I am given that these are the following patterns for the tiles/figures: 1, 1+3+1, 1+3+5+3+1, 1+3+5+7+5+3+1, 1+3+5+7+9+5+3+1. These are the first 5 figures and the patterns that arise through each of them. I am trying to figure what an equation for this would be because each time you add, you add by two and each time you subtract, you subtract by 2. However, how do I make an equation so it knows when to start decreasing by 2? Thanks!

• Hint: $1+3+5+\cdots+(2k-1)=k^2$.
– user378947
Commented Nov 26, 2016 at 22:48
• I don't understand what that means... Commented Nov 26, 2016 at 22:51
• It means that $1+3+5+7=4^2$, that $1+3+5+7+9=5^2$, that $1+3+5+7+9+11=6^2$ and so on. It tells you that the general pattern for your sequence is $2k^2-(2k-1)$.
– user378947
Commented Nov 26, 2016 at 22:54
• Where do you get the "-1" part from? I understand the rest of this but am still struggling to figure that part out. Commented Nov 28, 2016 at 0:48
• There are two standard ways to represent odd natural numbers: $2k+1$ where $k=0,1,2,3,\ldots$, and $2k-1$ where $k=1,2,3,4,\ldots$. I've used the last one because then the general term for your sequence is cleaner.
– user378947
Commented Nov 28, 2016 at 1:26

$$\begin{array} &u_1&=\underbrace{1}_{1^2}&=1^2\\ u_2&=\underbrace{1+3}_{2^2}+\underbrace{1}_{1^2}&=2^2+1^2\\ u_3&=\underbrace{1+3+5}_{3^2}+\underbrace{3+1}_{2^2}&=3^2+2^2\\ u_4&=\underbrace{1+3+5+7}_{4^2}+\underbrace{5+3+1}_{3^2}&=4^2+3^2\\ \vdots\\ u_n&=\underbrace{1+3+5+\cdots+(2n-1)}_{n^2}+\underbrace{\cdots+5+3+1}_{(n-1)^2}&=n^2+(n-1)^2\\ &&=\color{red}{2n^2-2n+1} \end{array}$$
\begin{align} u^n &=\sum_{r=1}^n (2r-1)^2+\sum_{r=1}^{n-1} (2(n-r)-1)^2\\ &=\sum_{r=1}^n (2r-1)^2+\sum_{r=1}^{n-1} (2r-1)^2\\ &=n^2+(n-1)^2\\ &=2n^2-2n+1 \end{align}