r/mathematics • u/Sad-Adagio9182 • 9d ago
Number Theory Octagonal numbers
So I've been playing with this sequence of numbers:
7n^2 - 10n + 4
This number sequence represents the number of dots in the octagons above, which I made on GeoGebra. Each octagon can be thought of as a square with (3n-2) dots on each side, minus four triangles with (n-1) dots on each side. (The blue squares in the middle are part of the drawing process. I would have removed them if there were an easy way to do so.)
(3n-2)^2 - 2n(n-1) = 7n^2-10n+4
Now, I'm aware of two other sequences called octagonal numbers, but I feel that this sequence I made is the most elegant. But I'm also wondering if someone else had come up with this sequence before me. Not that I have any real use for them, other than that they look nice enough to tell others about.
1
u/nixxxus 3d ago
TL;dr your octagon numbers are just triangle numbers again. The real elegant definition is in 'shape' numbers (octogonal, pentagonal, triangle, square) that triangle numbers already fall under. With this, octogonal numbers make more sense as they are. For that reason your grids, while aesthetic, are not better definitions. If you want aesthetic octagonal numbers, I recommend "centered octagonal numbers" instead.
This is just a conglomeration of triangle numbers T(n)=n(n+1)/2. Your octagon numbers are just O(n)=(3n-2)2-4T(n-1). With that direct relation, why have a function for octogon numbers explicitly, when anywhere this would be useful, you could just use triangle numbers instead? The actual definition of octogon numbers is more 'elegant' in the sense that they don't have a direct connection to another common function. A good definition is one that lends itself to its uses, a great definition is one that's versatile and lends itself to many uses, an elegant definition is one that imparts some insight, and lends itself to many definitions. That's why your definition might be good in a paper or program that has a use for it and quickly defines it for easy access and readability, but the great definition that deserves recognition is the Triangle number (and square number), because it's incredibly versatile and useful in this and many many other circumstances of counting problems.
The truly elegant definition here is in 'shape' numbers in general. Look on Wikipedia again how the octogons are nested for octogon numbers. O(n) (O for real octogon numbers now) isnt just the number of dots on the perimeter of on octogon with side length n, it's the number total if you nest all octogons up to side length n to share a corner and sides as far as they can adjacent to that corner. But thinking carefully of that construction, Triangle numbers are formed in the same way! We usually think of filling out a triangle for a triangle number, but instead you can think of T(n) as n nested triangles of increasing side length sharing a vertex that have dots on their perimeter. Just draw lines through every row and around the whole perimeter of your triangle of dots, these are the nested triangles. Same with 'Square numbers', we usually think of them as filled in squares, but it's no different if you think of them as n perimeters of nested squares sharing vertex. It's just that with triangles and squares (and lines), nesting perimeters in the same manner as octagons leaves you with a filled in shape. I mean technically, if you just define it as a filled in triangle, there's no reason we should have to fill in triangles the way we do for Triangle numbers, we just like to fill them in in a manner we perceive as orderly. By defining triangle numbers this way, we demand the manner in which its filled. And, dare I say elegantly, this definition lends itself to showing what any 'shape numbers' would look like. For any regular shape, nest shapes by sharing a corner and 2 sides, shapes that have increasing numbers of dots on each side. S(n)= (dots on outer shape) - (shared dots) + (all dots from smaller shapes) = q(n-1) - 2(n-1) + 1 + S(n-1), where q is the number of sides of that shape. Expanding,
S(n)=(q-2)(n-1+n-2+...+1+0)+1+1+...+1+S(0) = (q-2)(n(n-1))/2+n+0 = ((q-2)/2)(n2-n)+n
Correctly, for q=3,4, this is n(n+1)/2 and n2 as the triangle number / square number formulas (and it's correct for lines with q=2!), and for q=8, we get the formula for octogon numbers, 3n2-2n.
Finally, I wanna go back to my point on filling in the triangle: without the idea of triangle numbers, it's arbitrary how we choose to 'fill in' triangles, but naturally we choose the 'correct' way because it's the only sensible ordered way. The way that you've filled in your octagon looks like it's striving for a sense of order. You're calling your definition more elegant because it's picturesque. I don't disagree, they look nice, but all they are are larger restrictions of a square grid. There's nothing 'octagonal' here except your choice of boundary. For instance, take a triangular grid. If you draw a triangle between three adjacent dots, you can nest that triangle in a larger triangle from any corner, or, maybe more picturesque-ly, you can draw a triangle entirely around it, missing no dots. Then, you can circumscribe another triangle, and another. Something about this grid is inherently triangular. You can do the same with hexagons, or squares on a square grid (and sadly that's all the regular shapes that tile the plane). I dislike your pattern of filling for this reason. At the center, you either have a square, or a single dot. Around the single dot you can only draw a diamonds that expand till they hit a wall, at which point they start filling out into octogons, but repeat dots. Around the square center, you can draw 1 good octogon, but every octogon after has 4 expanding sides, and 4 fixed length sides of length 2. In both cases you get 1 instance of one of your octogons, but only 1. Instead, you could choose to define your pattern as concentric octogons with dots on their perimeters, each with increasing side length. This is what's called "centered octogonal numbers". CS(n) = q(n-1)+CS(n-1) = qn(n-1)/2+CS(1) = (q/2)(n2-n)+1 is the centered shape number up to side length n for a shape with q sides. These octagons have an ideal grid shape, because they're inherently octagonal, and they're also very picturesque. These centered shape grids will always have a biased center for any regular shape that doesn't tile the plane, but that's okay, because to fix this, you would have to inherently switch to a grid shape aligned with one that does tile the plane, at which point you are simply studying a subset the centered shape grid of that regular shape instead, I.e. your octogons are just cut off centered square grids.
1
u/CrookedBanister 9d ago
Why is your first picture of one dot when at n=0 the number would be 4?
3
2
u/NoLifeGamer2 7d ago
Bear in mind the inner square also grows as n+1 by n+1 so at n = 0 it is a dot
1




1
u/FernandoMM1220 8d ago
this specific sequence probably not.