Wikipedia:Reference desk/Archives/Mathematics/2010 January 10

= January 10 =

Sum
How do I sum all possible products from the numbers 1, 2, 3, ..., n? For example, 1x1+1x2+2x1+1x3+3x1+2x3+3x2+3x3+... —Preceding unsigned comment added by 75.41.186.123 (talk) 16:06, 10 January 2010 (UTC)


 * So by "all possible products" you mean products of two terms a, b where 1 &le; a, b &le; n and ab and ba are counted separately if a &ne; b. That looks like (1 + 2 + 3 + ... + n)2 to me. Gandalf61 (talk) 16:18, 10 January 2010 (UTC)

Gandalf61 is (obviously) correct. In case you need it in a more simplified form, it's $$[n(n+1)/2]^2$$. La  Al qu im  is ta  17:08, 10 January 2010 (UTC)


 * Is it a coincidence that this is also the sum of the first n cubes?--RDBury (talk) 17:51, 10 January 2010 (UTC)
 * Faulhaber's formula is relevant to that observation. Michael Hardy (talk) 01:16, 11 January 2010 (UTC)


 * No. Imagine the following grid is made up of blocks one unit thick:

-+---+---+---+---+ ^|  |       |           |               | ||   |       |           |               | ||   |       |           |               | 4| O |   M   |     K     |       J       | ||  |       |           |               | ||   |       |           |               | V|   |       |           |               | -+---+---+---+---+ ^|  |       |           |               | ||   |       |           |               | 3| H |   F   |     E     |       P       | ||  |       |           |               | V|   |       |           |               | -+---+---+---+---+ ^|  |       |           |               | 2| C |   B   |     I     |       N       | V|  |       |           |               | -+---+---+---+---+ 1| A |  D   |     G     |       L       | -+---+---+---+---+ |<1>|<- 2 ->|<--- 3 --->|<- 4 ->|
 * The volume of the whole thing is $$(1+2+3+4)^2$$. On the other hand, A is a 1×1×1 cube; using B as one layer, and C &amp; D put together as the second layer, we can make a 2×2×2 cube; using E, F &amp; G, and H &amp; I we can form a 3×3×3 cube; and from J, K &amp; L, M &amp; N, and O &amp; P we can form a 4×4×4 cube. So the total volume is also $$1^3+2^3+3^3+4^3$$. (My officemate Derek Boeckner and I decided one day to figure out geometrically why the sum of the first n cubes is the square of the sum of the first n integers, and this is the picture we came up with.) —Bkell (talk) 18:32, 10 January 2010 (UTC)
 * Very nice! (I recently happened to make a construction for the sum of consecutive squares here) --pm a 18:59, 10 January 2010 (UTC)
 * Another construction for the sum of the first n squares is presented as a marginal note in Infinitesimal Calculus by Henle and Kleinberg, ISBN 0486428869. Part of the construction is used as the illustration on the front cover. It packs six copies of the first n squares together to form a rectangular prism measuring $$\scriptstyle n\times(n+1)\times(2n+1)$$. —Bkell (talk) 20:25, 10 January 2010 (UTC)
 * I guess the construction in Infinitesimal Calculus is pretty similar to what you described. For some reason I thought you had used the formula for the volume of a pyramid, but that was a different discussion. —Bkell (talk) 20:48, 10 January 2010 (UTC)
 * See also WHAAOE I mean, Squared triangular number. -- Meni Rosenfeld (talk) 19:37, 10 January 2010 (UTC)

Harmonic series
What's the closed form for 1/1+1/2+1/3+...+1/n, where n is a positive integer? --75.41.186.123 (talk) 16:21, 10 January 2010 (UTC)
 * See Harmonic number. Bo Jacoby (talk) 16:47, 10 January 2010 (UTC).
 * That page doesn't give a true closed form. The closest thing to that is the integral, which doesn't exactly count, since calculating the integral requires manually adding up all the terms 1/1+1/2+1/3+...+1/n. --75.41.186.123 (talk) 16:49, 10 January 2010 (UTC)
 * The sum doesn't have a closed form in terms of elementary functions.
 * The page does give a good way to calculate it approximately,
 * $$H_n = \ln{n} + \gamma + \frac{1}{2}n^{-1} - \frac{1}{12}n^{-2} + \frac{1}{120}n^{-4} + \mathcal{O}(n^{-6})$$
 * -- Meni Rosenfeld (talk) 17:09, 10 January 2010 (UTC)