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.

A363518 Concentric square numbers on the faces of an n X n X n cube.

Original entry on oeis.org

1, 8, 20, 32, 50, 80, 116, 152, 194, 248, 308, 368, 434, 512, 596, 680, 770, 872, 980, 1088, 1202, 1328, 1460, 1592, 1730, 1880, 2036, 2192, 2354, 2528, 2708, 2888, 3074, 3272, 3476, 3680, 3890, 4112, 4340, 4568, 4802, 5048, 5300, 5552, 5810, 6080, 6356, 6632, 6914, 7208, 7508, 7808
Offset: 1

Views

Author

Nicolay Avilov, Jun 07 2023

Keywords

Comments

a(n) is the number of colored cubes in the outer layer of a cube made up of n^3 unit cubes. The cubes are painted in such a way that concentric square numbers are obtained on each face of the n X n X n cube.

Examples

			a(3) = 6*8 - 12*1 - 2*8 = 20;
a(5) = 6*17 - 12*3 - 2*8 = 50.
		

Crossrefs

Cf. A194274.

Programs

  • Mathematica
    Join[{1},LinearRecurrence[{3,-4,4,-3,1},{8,20,32,50,80},51]] (* Stefano Spezia, Jun 08 2023 *)
  • Python
    def A363518(n): return 6*((3*n>>2)+(n*(n+2)+1>>1)-(3*n+1>>2))-12*n+8 if n>1 else 1 # Chai Wah Wu, Jul 15 2023

Formula

a(n) = 6*A194274 - 12*n + 8, where n>1.
From Stefano Spezia, Jun 08 2023: (Start)
G.f.: (1 + 5*x + 5*x^4 + x^5)/((1 - x)^3*(1 + x^2)).
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3)- 3*a(n-4) + a(n-5) for n > 6. (End)