OFFSET
1,2
COMMENTS
This sequence shows the maximum number of spheres in a pyramid with a rectangular base, where the base consists of n spheres. The area of the base n is the product of the lengths of its edges a and b, where 0 <= b <= a. In order to find the maximum number of spheres in the pyramid a(n), for a certain n we have to find factors a and b as close to each other, i.e. as close to sqrt(n), as possible. Therefore, b = A033676(n). The number b also represents the number of floors in the pyramid (i.e., its height in spheres).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{i=0..b-1} (a-i)*(b-i), n=ab, 0 <= b <= a, b = A033676(n).
EXAMPLE
For n = a*b = 12, a and b must be as close to sqrt(12) as possible. Therefore, a=4, b=3 and a(n) = Sum_{i=0..2} (4-i)*(3-i) = 20.
For any prime number n, a(n) = n.
MATHEMATICA
Table[If[IntegerQ[Sqrt[n]], w = h = Sqrt[n], d = Divisors[n]; len = Length[d]/2; {w, h} = d[[{len, len+1}]]]; Sum[(w - i) (h - i), {i, 0, w - 1}], {n, 63}] (* T. D. Noe, Feb 28 2012 *)
CROSSREFS
KEYWORD
easy,nonn,changed
AUTHOR
Ivan N. Ianakiev, Feb 25 2012
STATUS
approved