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.
%I A219965 #14 Nov 01 2024 05:10:56 %S A219965 0,0,0,1,4,10,19,30,45,66,94,130,172,221,278,344,422,511,611,723,848, %T A219965 987,1140,1308,1491,1691,1909,2146,2401,2673,2965,3278,3614,3974,4355, %U A219965 4759,5186,5638,6117,6623,7156,7716,8305,8923,9571,10249,10958,11700,12475,13285,14127,15003,15914,16862,17849,18874,19937,21037,22177,23358,24581,25846,27153,28504 %N A219965 Number of non-intersecting unit cubes regularly packed into the tetrahedron of edge length n. %C A219965 The tetrahedron may be aligned with the Cartesian axes by putting its triangular basis on the horizontal plane, with four vertices at (x, y, z) = (0, 0, 0), (n, 0, 0), (n/2, sqrt(3)*n/2, 0) and (n/2, n/(2*sqrt(3)), n*sqrt(2/3)) see A194082, A020769, A157697. %C A219965 The volume of tetrahedron is a third times the area of the base triangle times height, (1/3) * (sqrt(3)*n^2/4) * n*sqrt(2/3) = n^3/(3*2^(3/2)) = A020829*n^3. This defines an obvious upper limit of floor(n^3/sqrt(72)) = A171973(n) of placing unit cubes into this tetrahedron. %C A219965 Regular packing: We place the first layer of unit cubes so they touch the floor of the tetrahedron. Their number is limited by the area of the triangular horizontal section of the plane z=1 inside the tetrahedron, which touches all of them; this isosceles horizontal triangle has edge length E(n,z) = n-z*sqrt(3/2). This edge length is a linear interpolation for triangular horizontal cuts between z=0 at the bottom and the summit of the tetrahedron at z=n*sqrt(2/3). %C A219965 This first layer confined by a triangle characterized by E(n,z) may host RegSquInTri(E) := sum_{y=1..floor(E*sqrt(3)/2)} floor(E-y*2/sqrt(3)) cubes, following recursively the same regular placement and counting strategy as for squares in isosceles triangles, see A194082. %C A219965 The number of unit cubes in the next layer, between z=1 and z=2, is limited by the area of the horizontal section of the triangle z=2 inside the tetrahedron, where the triangle has edge length n-z*sqrt(3/2). %C A219965 So in layer z=1, 2, ... we insert ReqSquInTri(E(n,z)) cubes. a(n) is the sum over all these layers with z limited by the z-value of the vertex at the summit. %C A219965 There is a generalization to placing unit cubes of higher dimensions into higher dimensional tetrahedra. %C A219965 The growth is expected to be roughly equal to the growth of A000292. %H A219965 R. J. Mathar, <a href="/A219965/a219965.jpg">Illustration of 30 cubes at n=8</a> %H A219965 R. J. Mathar, <a href="/A219965/a219965_1.jpg">Illustration of 66 cubes at n=10</a> %H A219965 R. J. Mathar, <a href="/A219965/a219965_2.jpg">Illustration of 221 cubes at n=14</a> %F A219965 a(n) <= A171973(n). %p A219965 # Number or squares in isosceles triangle of edge length n. %p A219965 RegSquInTri := proc(n) %p A219965 add(floor(n-2*y/sqrt(3)), y=1..floor(n*sqrt(3)/2)) ; %p A219965 end proc: %p A219965 A219965 := proc(n) %p A219965 local a,z,triedg ; %p A219965 a := 0 ; %p A219965 for z from 1 to floor(n*sqrt(2/3)) do %p A219965 triedg := n-z*sqrt(3/2) ; %p A219965 a := a+ RegSquInTri(triedg) ; %p A219965 end do: %p A219965 return a; %p A219965 end proc: %K A219965 nonn %O A219965 1,5 %A A219965 _R. J. Mathar_, Dec 02 2012