login
a(n) is equal to the number of black 1 X 1 X 1 cubes in a certain coloring of the n X n X n cube (see comments for precise definition).
1

%I #24 Oct 02 2023 22:26:14

%S 1,8,7,32,57,112,159,256,353,504,647,864,1081,1376,1663,2048,2433,

%T 2920,3399,4000,4601,5328,6047,6912,7777,8792,9799,10976,12153,13504,

%U 14847,16384,17921,19656,21383,23328,25273,27440,29599,32000,34401,37048,39687

%N a(n) is equal to the number of black 1 X 1 X 1 cubes in a certain coloring of the n X n X n cube (see comments for precise definition).

%C The coloring of the n X n X n cube is carried out as follows. First, the cubes of the central cross are painted black. For odd cubes, the ends of the central cross are 1 X 1 squares; for even cubes, the ends of the central cross are 2 X 2 squares. Then all the cubes adjacent to black are painted white so that a layer is obtained with all white cubes. At the next step, all cubes adjacent to white are painted black so that a layer of black cubes is obtained, and so on, until all the cubes of the n X n X n cube are painted.

%H Nicolay Avilov, <a href="/A365486/a365486.jpg">Illustration of initial terms</a>

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).

%F Let r = n (mod 4), then a(n) = (n^3)/2 if r = 0; (n^3 - 3*n)/2 +2 if r = 1; (n^3)/2 + 4 if r = 2; (n^3 - 3*n)/2 - 2 if r = 3.

%F G.f.: x*(1 + 6*x - 9*x^2 + 20*x^3 + 7*x^4 - 2*x^5 + x^6)/((-1 + x)^4*(1 + x)^2*(1 + x^2)). - _Thomas Scheuerle_, Sep 06 2023

%e a(3) = 7;

%e a(5) = 13 + 44 = 57;

%e a(9) = 25 +236 + 92 = 353.

%t LinearRecurrence[{2, 0, -2, 2, -2, 0, 2, -1}, {1, 8, 7, 32, 57, 112, 159, 256}, 50] (* _Amiram Eldar_, Sep 05 2023 *)

%o (PARI) Vec(x*(1 + 6*x - 9*x^2 + 20*x^3 + 7*x^4 - 2*x^5 + x^6)/((-1 + x)^4*(1 + x)^2*(1 + x^2)) + O(x^50)) \\ _Thomas Scheuerle_, Sep 06 2023

%Y Cf. A266725.

%K nonn,easy

%O 1,2

%A _Nicolay Avilov_, Sep 05 2023