Given $n$ sticks, what is the formula for how many squares that can form with the sticks, where the square's sides each one matchstick? No breaking the matchsticks or allowing them to intersect. Also, the matchsticks are only to be placed on a 2-d plane.
So, the sequences will be :
$\{4, 7, 10, 12, 15, 17, 20, 22, 24, 27, 29, 31, 34, 36, 38, 40, ... \}$
Explanation :
For $n = 4$ sticks, only 1 square can be formed
For $n = 7$ sticks, we can form 2 squares
For $n = 10$ sticks, there are 3 squares
For $n = 12$ sticks, we can form 4 squares
Note : I have been searched for this question on the internet, the formula will be
For $n\geq 4$ , where $r\geq 1, c\geq 1, 0 \leq a < r$ and $r, c, a \in \mathbb{Z}$
Then the formula was
$r + c(2r + 1) + 2a + \left \lceil \frac{a}{a+1} \right \rceil \leq n$
I found it in this link
But it can't help me for finding the simple and easy formula from n variable. Because I just found the formula by the n variable without any other variable to make this problem solved quickly
It appears that OP wants a formula for the sequence $$4,7,10,12,15,17,20,22,24,27,29,31,34,36,38,40,\dots$$ This sequence gives the smallest number of sticks of length $1$ needed to construct $n$ squares with sides of length $1$, $n=1,2,3,\dots$ and is tabulated at the Online Encyclopedia of Integer Sequences. The formula given there is $$a_n=2n+\lceil2\sqrt n\rceil$$ where $\lceil m\rceil$ is the ceiling function, the smallest integer not less than $m$. A proof is given in Buchholz and de Launey, The square, the triangle, and the hexagon. This link is also taken from the OEIS.