Centered Octahedral Number


What do you mean by a Centered octahedral number? Let’s decode.

Firstly, what is an Octahedron?

An octahedron is an eight−sided, equilateral triangle−shaped three−dimensional geometric shape. With 8 vertices, 12 edges, and 6 square faces, it is a polyhedron. One of the five Platonic solids, which are regular, convex polyhedra with symmetrical vertex arrangements and identical faces, is the octahedron.

The octahedron has a variety of fascinating characteristics and uses, including crystallography, where it is used to describe the structure of certain crystals, and computer graphics, where it is used to model objects in three dimensions. Numerous other natural phenomena, including the structure of some viruses and the form of some crystals, also exhibit the octahedron shape.

Look at the diagram below, and you will get a clear picture of what an octahedron is.

Now, what is an Octahedral number?

The number of points in an octahedron with evenly spaced points is symbolized by an octahedral number, which is a figurative number. To put it another way, it is the number of balls needed to build an octahedron with a specific number of balls in each layer.

The following are the initial octahedral numbers:

1, 6, 19, 44, 85, 146, 231, 344, 489, 670, ...

Applications for octahedral numbers can be found in many fields, including crystallography, chemistry, and geometry. For instance, they are used to specify the number of atoms that can be grouped in a specific kind of chemical structure to surround a core atom.

Look at the diagram below to understand octahedral number.

Moving to What is a Centered octahedral number?

The number of points in an octahedron made up of evenly spaced points, where the octahedron is centered at the origin, is referred to as the centered octahedral number. In other words, it is the number of lattice points within an octahedron centered at the origin in a three−dimensional cubic lattice.

These are the first few centered octahedral numbers:

1, 7, 25, 63, 129, 231, 377, 575, 833, 1159, ...

The formula for the sum of the first n−centered square numbers can be used to obtain the formula for the nth−centered octahedral number, which is:

Sn = n(2n−1)(2n+1)/3

The first n−centered square numbers can be added, then multiplied by two to get the nth−centered octahedral number:

Co_n = 2Sn = 2n(2n−1)(2n+1)/3

Simplifying this expression, we get:

Co_n = (2n+1)(2n^2+2n+3)/3

Centered octahedral numbers are used to indicate the number of atoms that can be grouped around a central atom in a particular kind of chemical structure. They are useful in many fields, including crystallography. They are also connected to the two−dimensional lattice path counting Delannoy numbers.

Approach

Here is the stepwise approach to calculating the Centered octahedral number.

  • Specify or take n as user input

  • Use the formula Co_n = (2n+1)(2n^2+2n+3)/3 to calculate centered octahedral number

  • Print the centered octahedral number to the console.

C++ Implementation

Too much theory? Now let’s get to code. Let’s convert the approach discussed above to c++ code.

Example

#include <iostream>
using namespace std;

int centered_octahedral(int n) {
    return (2 * n + 1) * (2 * n * n + 2 * n + 3) / 3;
}

int main() {
    int n= 6;
    
    cout << "The " << n << "th centered octahedral number is: " << centered_octahedral(n) << endl;
    return 0;
}

Output

The 6th centered octahedral number is: 377

Time Complexity: O(1)

Space Complexity: O(1)

Conclusion

In this article, we have covered a detailed explanation of the centered octahedral number and the way to calculate the nth centered octahedral number. Hope you have a clear picture of the concept now.

Updated on: 23-Aug-2023

78 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements