OFFSET
1,2
COMMENTS
There are fewer visible cubes on the bottom than on the top.
LINKS
Leo Tavares, Illustration: Diamond Branches
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 5*n^2 - 8*n + 4.
a(n) = n^3 - (n-2)^3 - (n-2)^2. - Joerg Arndt, Jun 06 2016
a(n) = A168668(n-1) + 1. - Altug Alkan, Oct 06 2017
G.f.: (-1 - 5*x - 4*x^2)/(-1 + x)^3. - Michael De Vlieger, Oct 06 2017
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. - Wesley Ivan Hurt, Oct 06 2017
a(n) = A000566(n-1) + A000566(n), the sum of consecutive heptagonal numbers. - Charlie Marion, Jul 01 2021
a(n) = n^2 + 4*(n-1)^2. - Leo Tavares, Mar 24 2022
EXAMPLE
a(3)=25 because around a 3 X 3 X 3 cube, when it's on a table, it's possible to see only 25 little cubes (8 on each of the 2 bottom layers and 9 on the top layer).
MAPLE
MATHEMATICA
Table[5 n^2 - 8 n + 4, {n, 46}] (* or *)
LinearRecurrence[{3, -3, 1}, {1, 8, 25}, 46] (* or *)
CoefficientList[Series[(-1 - 5 x - 4 x^2)/(-1 + x)^3, {x, 0, 45}], x] (* Michael De Vlieger, Oct 06 2017 *)
PROG
(Magma) [5*n^2-8*n+4: n in [1..60]]; // Vincenzo Librandi, Jun 06 2016
(PARI) a(n) = 5*n^2 - 8*n + 4; \\ Altug Alkan, Oct 06 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sébastien Dumortier, Jun 05 2016
EXTENSIONS
a(2) corrected and entry edited by Andrey Zabolotskiy, Oct 06 2017
STATUS
approved