login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A098928 Number of cubes that can be formed from the points of a cubical grid of n X n X n points. 5
0, 1, 9, 36, 100, 229, 473, 910, 1648, 2795, 4469, 6818, 10032, 14315, 19907, 27190, 36502, 48233, 62803, 80736, 102550, 128847, 160271, 197516, 241314, 292737, 352591, 421764, 501204, 592257, 696281, 814450, 948112, 1098607, 1267367 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Skew cubes are allowed.
LINKS
Baitian Li, Table of n, a(n) for n = 1..10000 (terms 1..101 from E. J. Ionascu and R. A. Obando)
E. J. Ionascu and R. A. Obando, Counting all cubes in {0,1,...,n}^3, arXiv:1003.4569 [math.NT], 2010.
Eugen J. Ionascu and Andrei Markov, Platonic solids in Z^3, Journal of Number Theory, Volume 131, Issue 1, January 2011, Pages 138-145.
Eugen J. Ionascu and R. A. Obando, Cubes in {0,1,...,N}^3, INTEGERS, 12A (2012), #A9. - From N. J. A. Sloane, Feb 05 2013
I. Larrosa, SMSU Problem Corner.
EXAMPLE
For n = 3 there are 8 cubes of volume 1 and 1 cube of volume 8; thus a(3)=9. - José María Grau Ribas, Mar 15 2014
a(6)=229 because we can place 15^2 cubes in a 6 X 6 X 6 cubical grid with their edges parallel to the faces of the grid, plus 4 cubes of edge 3 with a vertex in each face of the lattice and the other two vertices on a diagonal.
MATHEMATICA
Needs["Quaternions`"];
(* Initialize variables *)
R = 20;
NN = 1010;
(* Quaternion operations *)
test[q_Quaternion] :=
Module[{unit, res, a, b, c, u, v, w, p},
If[Round[Norm[q]] > R, Return[]];
If[q == Quaternion[0, 0, 0, 0], Return[]];
unit = Quaternion[0, 1, 0, 0];
res = q ** unit ** Conjugate[q];
a = Abs[res[[2]]] + Abs[res[[3]]] + Abs[res[[4]]];
unit = Quaternion[0, 0, 1, 0];
res = q ** unit ** Conjugate[q];
b = Abs[res[[2]]] + Abs[res[[3]]] + Abs[res[[4]]];
unit = Quaternion[0, 0, 0, 1];
res = q ** unit ** Conjugate[q];
c = Abs[res[[2]]] + Abs[res[[3]]] + Abs[res[[4]]];
For[i = 1, i <= (R - 1)/Max[a, b, c], i++,
If[SquareFreeQ[i], {u = a*i;
v = b*i;
w = c*i;
p = Max[u, v, w] + 1;
coe[[p + 1, 4]] += (1);
coe[[p + 1, 3]] -= (u + v + w);
coe[[p + 1, 2]] += (u*v + v*w + w*u);
coe[[p + 1, 1]] -= (u*v*w)}]]];
(* Set up coefficient matrix *)
coe = ConstantArray[0, {NN, 4}];
(* Loop through quaternions *)
rt = Ceiling[Sqrt[R]] + 1;
For[s = -rt, s <= rt, s++,
For[x = -rt, x <= rt, x++,
For[y = -rt, y <= rt, y++,
For[z = -rt, z <= rt, z++, test[Quaternion[s, x, y, z]];
test[Quaternion[s + 0.5, x + 0.5, y + 0.5, z + 0.5]]; ]]]];
newCoe = coe;
newCoe[[2 ;; ;; 2]] = coe[[2 ;; ;; 2]]/2;
(* Calculate and output results *)
For[i = 2, i <= R + 1, i++, ans = 0;
For[j = 4, j >= 1, j--, newCoe[[i, j]] += newCoe[[i - 1, j]];
ans = ans*(i - 1) + newCoe[[i, j]];
];
Print[i - 1, " ", ans/24]; ];
(* Haomin Yang, Aug 29 2023 *)
PROG
(C++) // see link above
CROSSREFS
Cf. A103158.
Cf. A000537 (without skew cubes), A002415 (number of squares with corners on an n X n grid), A108279, A102698.
Sequence in context: A231688 A000537 A114286 * A139469 A103158 A298442
KEYWORD
nonn
AUTHOR
Ignacio Larrosa Cañestro, Oct 19 2004, Sep 29 2009
EXTENSIONS
Edited by Ray Chandler, Apr 05 2010
Further edited by N. J. A. Sloane, Mar 31 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 03:29 EDT 2024. Contains 371767 sequences. (Running on oeis4.)