cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A382973 a(n) = 4*n^3 - 6*n^2 + 6*n - 2 + (-1)^n.

Original entry on oeis.org

1, 19, 69, 183, 377, 683, 1117, 1711, 2481, 3459, 4661, 6119, 7849, 9883, 12237, 14943, 18017, 21491, 25381, 29719, 34521, 39819, 45629, 51983, 58897, 66403, 74517, 83271, 92681, 102779, 113581, 125119, 137409, 150483, 164357, 179063, 194617, 211051, 228381, 246639
Offset: 1

Views

Author

Nicolay Avilov, Jun 02 2025

Keywords

Comments

a(n) is the number of 1 X 1 X 1 black cubes in a cube (2*n - 1) X (2*n - 1) X (2*n - 1), which is made up of 1 X 1 X 1 black cubes and 1 X 1 X 1 white cubes. In this case, any 1 X 1 X 1 cube is either completely black or completely white. The black and white cubes are arranged as follows: if the central cube has coordinates (0, 0, 0), then all cubes with coordinates (0, y, z), (x, 0, z) and (x, y, 0) are black. Then the cubes adjacent to the black ones are painted white so that a triangular layer with all white cubes is obtained. There will be eight such layers. In the next step, all cubes adjacent to the white ones are painted black so that a triangular layer of black cubes is formed, and so on, alternating layers of black cubes and layers of white cubes until all the cubes are painted (see the link "Illustration of coloring a cube").

Examples

			a(2) = 3^3 - 8*1 = 19;
a(3) = 5^3 - 8*7 = 69.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{3, -2, -2, 3, -1}, {1, 19, 69, 183, 377}, 20] (* Hugo Pfoertner, Jun 12 2025 *)

Formula

a(n) = (2n - 1)^3 - 8*A011934(n-1).
G.f.: x*(1 + 16*x + 14*x^2 + 16*x^3 + x^4)/((1 - x)^4*(1 + x)). - Stefano Spezia, Jun 12 2025