Wikipedia:Reference desk/Archives/Mathematics/2011 May 8

= May 8 =

LaTeX arithmetic
(Not sure which board is most appropriate.) I'm trying to use LaTeX, specifically Kile, to do some basic arithmetic. However, I seem to be stuck right back at the start, as I can't seem to get /multiply to do anything meaningful. Is this the command I want? All I want to do is perform some command on say, "5" and "4" and get "20" or "9" or "1" or whatever, as appropriate. Grandiose (me, talk, contribs) 15:24, 8 May 2011 (UTC)
 * I'm confused about what you're trying to do. As far as I know, LaTeX is for typesetting, not for computation. You can use

5\cdot4=20
 * To typeset $$5\cdot4=20$$, but LaTeX isn't supposed to do the calculation itself. If I missed your point completely, can you provide more background? -- Meni Rosenfeld (talk) 16:42, 8 May 2011 (UTC)
 * I was hoping it could basic arithmetic as is suggested by places like this, but I couldn't follow what I needed to do off any of them. Grandiose (me, talk, contribs) 17:18, 8 May 2011 (UTC)
 * Yes it can do that. I don't know how... Staecker (talk) 20:27, 8 May 2011 (UTC)

OK I figured something out. I've never done this before, so I don't know if I'm doing it the right way. Integers can be stored in numbered "count registers". Here I'll define two count registers equal to 2 and 3, then display them, then multiply them and display the product: \count1=2 \count2=3 \the\count1 \the\count2 \multiply\count1\count2 \the\count1 The displayed output is 236. The registers are displayed using "\the", and "\multiply" overwrites the first register with the product. Staecker (talk) 20:40, 8 May 2011 (UTC)
 * Brilliant. Do you happen to know what addition, subtraction, and division will be? Grandiose (me, talk, contribs) 19:41, 9 May 2011 (UTC)
 * /advance is addition, it would seem, and /advance/count1-/count2 (for example) works for subtraction. I can't imagine / is going to work, though, in multiplication. Lucky for me, I don't have to do any. Grandiose (me, talk, contribs) 19:48, 9 May 2011 (UTC)
 * \divide is for division. See TeX/count for this and basically no additional information. Staecker (talk) 22:34, 9 May 2011 (UTC)


 * Make sure to use the backslash \ for LaTeX commands, and not the forward slash /. So it's \count and \multiply and not /count or /multiply. — Fly by Night  ( talk )  00:51, 12 May 2011 (UTC)

Interesting series...
Dear Wikipedians:

I am trying to find the sum of an interesting series whose general term is:

$$\left(\frac{1}{3}\right)\left(\frac{1}{3}\right)^2\cdots\left(\frac{1}{3}\right)^n$$

I realized that the power forms the triangular numbers, and the general term of triangular numbers is $$\frac{n^2+n}{2}$$, therefore the general term of the interesting series above can be written as:

$$\left(\frac{1}{3}\right)^\frac{n^2+n}{2}$$

$$=\left(\frac{1}{3}\right)^\frac{n^2}{2}\left(\frac{1}{3}\right)^\frac{n}{2}$$

$$=\left(\sqrt{\frac{1}{3}}\right)^{n^2}\left(\sqrt{\frac{1}{3}}\right)^n$$

So at this point it is clear that there is a geometric sequence subcomponent, $$\left(\sqrt{\frac{1}{3}}\right)^n$$, to my interesting series. However, I am at a total loss about what to do for the $$\left(\sqrt{\frac{1}{3}}\right)^{n^2}$$ subcomponent, and also about how to separate the two subcomponents so that I could sum each one up individually.

Any help is greatly appreciated.

70.31.155.244 (talk) 16:03, 8 May 2011 (UTC)
 * I don't think there's a closed-form expression for the sum up to a finite term. For the infinite sum, Mathematica gives the result (assuming I'm reading it correctly) $$\theta_2(0;1/\sqrt{3})$$ (see Theta function) which is 1.371759117358... . I have no idea how to arrive at this result. -- Meni Rosenfeld (talk) 16:36, 8 May 2011 (UTC)

I don't think you'll be able to separate the two parts you're talking about. Note also that n2 + n is always even, so your exponent is always an integer. Michael Hardy (talk) 16:39, 8 May 2011 (UTC)

The article titled theta function says this:

\vartheta(z; \tau) = \sum_{n=-\infty}^\infty \exp (\pi i n^2 \tau + 2 \pi i n z) $$ There you see a sum of two terms in the exponent, in which one is a constant times n2 and the other is a constant times n, just as in your series. So we would want
 * $$ e^{\pi i n^2 \tau + 2 \pi i n z} = \left(\sqrt{\frac13}\right)^{n^2 + n}. \, $$

Recall that that
 * $$ \sqrt{\frac13} = e^{-(\log_e 3)/2}.\, $$

So
 * $$ \left(\sqrt{\frac13}\right)^{n^2+n} = e^{-(n^2+n)(\log_e 3)/2}.\, $$

So we want
 * $$ \frac{-(n^2+n)(\log_e 3)}{2} = \pi i n^2\tau + 2\pi inz $$

This will hold if the coefficients of n2 and n agree. Thus we need
 * $$ \frac{-\log_e 3}{2} = \pi i\tau, $$

and
 * $$ \frac{-\log_e 3}{2} = 2\pi iz. $$

So
 * $$ \tau = \frac{i\log_e 3}{\pi} $$

and
 * $$ z = \frac{i\log_e 3}{2\pi}. $$

But you probably intended your series to run from 0 to &infin; rather than from &minus;&infin; to &infin;, so mutatis mutandis....

To be continued...... Michael Hardy (talk) 17:03, 8 May 2011 (UTC) So

\sum_{n=-\infty}^\infty \exp (\pi i n^2 \tau + 2 \pi i n z) = 1 + \sum_{n=1}^\infty \exp (\pi i n^2 \tau + 2 \pi i n z) + \exp (\pi i n^2 \tau - 2 \pi i n z) $$

To be continued.... Michael Hardy (talk) 17:22, 8 May 2011 (UTC)
 * $$ = 1 + \sum_{n=1}^\infty \exp (\pi i n^2 \tau)\left(\exp(2\pi inz) + \frac{1}{\exp(2\pi inz)} \right) $$
 * $$ = 1 + \sum_{n=1}^\infty \exp (\pi i n^2 \tau)\left(\exp(2\pi inz) + \frac{1}{\exp(2\pi inz)} \right) $$

To be continued.... Michael Hardy (talk) 21:04, 8 May 2011 (UTC)


 * Hi Michael, $$\tau=i\frac{\log 3}{2\pi}$$ and $$z=i\frac{\log 3}{4\pi}$$ so that
 * $$\vartheta(i\frac{\log 3}{4\pi};i\frac{\log 3}{2\pi})=\sum_{n=-\infty}^\infty 3^{-\frac{n(n+1)}2}$$
 * $$= \left(\sum_{n=-\infty}^{-2}+\sum_{n=-1}^0+\sum_{n=1}^\infty \right) 3^{-\frac{n(n+1)}2}$$
 * $$= \sum_{n=2}^{\infty}3^{-\frac{n(n-1)}2}+2+\sum_{n=1}^\infty 3^{-\frac{n(n+1)}2}$$
 * $$= 2+2\sum_{n=1}^\infty 3^{-\frac{n(n+1)}2}$$
 * and the final result is
 * $$ \sum_{n=1}^\infty 3^{-\frac{n(n+1)}2}=\frac 1 2 \vartheta(i\frac{\log 3}{4\pi} ; i\frac{\log 3}{2\pi}) -1.$$
 * Bo Jacoby (talk) 14:18, 9 May 2011 (UTC).
 * Or even simpler:
 * $$ \sum_{n=0}^\infty 3^{-\frac{n(n+1)}2}=\frac 1 2 \vartheta(i\frac{\log 3}{4\pi} ;

i\frac{\log 3}{2\pi}).$$
 * Bo Jacoby (talk) 07:37, 11 May 2011 (UTC).

Thanks to everyone for your contribution. Now I know that the series in question cannot possibly have any closed form expressions using elementary functions and their combinations/compositions thereof. L33th4x0r (talk) 17:15, 11 May 2011 (UTC)