OFFSET
0,3
COMMENTS
The incarceration value for each cell is the highest value on the path of least resistance off the cube minus the value of the cell. Negative values are set to zero.
This extends the idea of the 2D water retention on mathematical surfaces to the 3D cube.
A number cube contains the numbers 1 to n^3 without duplicates.
This incarceration sequence requires the smallest numbers to be placed in all possible internal cells or (n-2)^3 cells. This is not the maximum possible retention for a number cube (see link below)
Each internal cell has 6 neighbors and thus 6 initial possible pathways of escape.
A lake is a body of water that has dimensions of (n-2)x(n-2)x(n-2). All other retaining areas are called ponds. More than one lake is possible in the same cube.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Craig Knecht, 7x7x7 number cube with one pond
Craig Knecht, Examples of lakes in higher order cubes
Craig Knecht, Maximum incarceration order 4 number cube
Walter Trump, Three lakes in a 6x6x6 cube
Wikipedia, Water retention on mathematical surfaces
Index entries for linear recurrences with constant coefficients, signature (7,-21,35,-35,21,-7,1).
FORMULA
a(n) = (n^3 - 3*n^2 + 27*n - 8) / 2 * (n-1)^3 for n>0.
From Colin Barker, Jul 31 2016: (Start)
a(n) = (n^6-6*n^5+39*n^4-99*n^3+108*n^2-51*n+8)/2 for n>0.
a(n) = 7*a(n-1)-21*a(n-2)+35*a(n-3)-35*a(n-4)+21*a(n-5)-7*a(n-6)+a(n-7) for n>7.
G.f.: x^2*(21+145*x-37*x^2+99*x^3+128*x^4+4*x^5) / (1-x)^7.
(End)
EXAMPLE
An order 3 number cube contains the numbers 1 to 27. The smallest value 1 is placed in the single central cell. The largest possible 6 numbers 27,26,25,24,23,22 occupy the central cell in each face of the cube. Thus the path of least resistance off the cube is through cell 22. The total incarceration is then 22-1 = 21 units of incarceration.
2 3 4 10 27 11 14 15 16
5 23 6 24 1 25 17 22 18
7 8 9 12 26 13 19 20 21
PROG
(PARI) concat([0, 0], Vec(x^2*(21+145*x-37*x^2+99*x^3+128*x^4+4*x^5)/(1-x)^7 + O(x^50))) \\ Colin Barker, Aug 01 2016
(PARI) a(n) = (n^3 - 3*n^2 + 27*n - 8)/2 * (n-1)^3 \\ Charles R Greathouse IV, Aug 05 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Craig Knecht, Jul 24 2016
EXTENSIONS
Edited and a(20)-a(29) added by Colin Barker, Aug 01 2016
STATUS
approved