Centered Octagonal Number Calculator
Find the centered octagonal number at an index, which is also the odd square at that position.
What it does
Centered octagonal numbers count points in an octagonal pattern grown from a centre. A striking fact about this family is that its values are exactly the odd squares. The sequence begins 1, 9, 25, 49, 81 and 121.
The coincidence is not accidental. A centred octagonal figure can be rearranged into a square whose side is two n plus one, which is always odd. That is why the nth centred octagonal number equals the square of the nth odd integer.
The formula is two n plus one, squared. It is an integer for every n and needs no division. The indexing here starts at zero, matching the standard sequence where the first value is one.
This page computes the value with exact integer arithmetic and shows the previous term and ratio beside it. It gives counts only, not a drawing of the arrangement.
The index limit is one hundred thousand, which gives a value with about eleven digits printed in full.
How to use
- Enter an index n from 0 to 100,000.
- Read the centered octagonal number in the main result box.
- Check the previous term and growth beside it.
- The default index 3 reproduces the worked example.
- Try n = 4 to confirm the value 81.
- Verify the result by squaring two n plus one.
Formula
- n
- The index, starting at zero.
- C(n)
- The centered octagonal number, equal to the nth odd square.
The general centred polygonal formula with eight sides simplifies to four n squared plus four n plus one, which factors as two n plus one squared. The value at n = 0 is one and the value at n = 1 is nine.
Worked example
Example: index 3
The page opens with n = 3.
- Compute two n plus one: 2 x 3 + 1 = 7.
- Square it: 7 x 7 = 49.
- The tool reports 49, previous term 25, and growth 1.96x.
- Check the previous value: 2 x 2 + 1 = 5, and 5 squared is 25.
- The value 49 is also the seventh square number and an odd square.
- With four layers the count reaches 81, the square of nine.
Reference table
| n | 2n + 1 | C(n) | Previous |
|---|---|---|---|
| 0 | 1 | 1 | n/a |
| 1 | 3 | 9 | 1 |
| 2 | 5 | 25 | 9 |
| 3 | 7 | 49 | 25 |
| 4 | 9 | 81 | 49 |
| 5 | 11 | 121 | 81 |
Limits
- Indices above 100,000 are rejected to keep the output readable.
- The growth column is rounded to two decimals.
- The tool gives counts, not drawings of the layers.
- Only the standard centred octagonal offset starting at zero is used.
Common mistakes
- Using the ordinary octagonal number instead of the centred one.
- Squaring two n rather than two n plus one.
- Starting the index at one and shifting every value.
- Expecting a cubic formula when the sequence is quadratic.
- Confusing this with the octahedral numbers.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is C(3)?
C(3) = 7 squared = 49.
What is C(4)?
C(4) = 9 squared = 81.
Why are these odd squares?
Two n plus one is always odd, and the formula squares it.
Questions
Are these the same as odd squares?
Yes, every centred octagonal number is the square of an odd integer.
Why does the formula simplify so far?
The centred octagonal formula factors into a perfect square.
Where does indexing start?
At zero, giving the value one for the centre alone.
How fast do they grow?
Quadratically, like four n squared.
Are values exact?
Yes. Integer multiplication is used.
What index range is accepted?
Zero through 100,000.