OFFSET
1,2
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.
LINKS
Nicolay Avilov, Illustration of initial terms
Index entries for linear recurrences with constant coefficients, signature (3,-4,4,-3,1).
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)
EXAMPLE
a(3) = 6*8 - 12*1 - 2*8 = 20;
a(5) = 6*17 - 12*3 - 2*8 = 50.
MATHEMATICA
Join[{1}, LinearRecurrence[{3, -4, 4, -3, 1}, {8, 20, 32, 50, 80}, 51]] (* Stefano Spezia, Jun 08 2023 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicolay Avilov, Jun 07 2023
STATUS
approved