# Thread: Finding a formula for a sequence

1. ## Finding a formula for a sequence

4, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12...

It's based on fewest number of 2-blocks required to surround an increasing number of 1-blocks.
I've tried the method where you find differences between terms (up to 6 columns worth), but cannot get it to resolve to one value. Does this mean that it isn't quadratic?

Tried using Excel to find a line of best fit and a 'moving average' line fits really well. Still didn't help me derive a formula.

Any help would be greatly appreciated!

2. ## Re: Finding a formula for a sequence

$3+\lceil 2\sqrt{n}-1\rceil$

That is the smallest integer no smaller than the number, also known as the ceiling function. Example:
$\lceil 1.1\rceil = \lceil 1.9 \rceil = \lceil 2 \rceil = 2$

In general, this website is very useful.

https://oeis.org/search?q=1%2C2%2C3%...lish&go=Search

I used your sequence shifted down 3, so that's why it is 3+...