The infinite sum which equals -1/12

S. Ramanujan and G. H. Hardy

On 16 January, 1913, Srinivasa Ramanujan, a clerk living in Madras, India, sent a letter to Oxford professor Godfrey Harold Hardy, which contained many of his intuitive mathematical musings, one of which led to the conclusion:

\displaystyle \sum_{n=1}^{\infty} n = 1 + 2 + 3 + 4 + 5 + ... = \frac{-1}{12}

In normal mathematics, this bizarre result would be just that — a bizarre result. In high school math, as well as in most university math courses, a response of \frac{-1}{12} would get a mark of zero. On the face of it, the series is clearly divergent, and there is no reason to doubt that the actual answer should be \infty.

What is also clear is that Ramanujan and Hardy were not dummies, having helped to revolutionize early 20th century mathematics in England, as well as making people begin to take notice that India has, for a long time, made significant advancements in mathematics. It is also important to note that this bizarre result is used today in string theory, in the context of the Riemann Zeta function.

\displaystyle \zeta(z) = \sum_{n=1}^\infty \frac{1}{n^z} = \frac{1}{1^z}+\frac{1}{2^z}+\frac{1}{3^z}+...

The difference is that the Zeta function works with complex numbers. The zeta function does not replace ordinary summation. Also, a finite sum still exists in the real numbers if their partial sums are shown to converge.

The zeta function comes from a well-known summation which goes something like:

\displaystyle \frac{1}{1-z} = 1 + z + z^2 + z^3 + z^4 + ... ; -1 < z < 1

The restriction on z is important if the series is to converge. When z wanders outside those boundaries, the series diverges, and the sytem breaks down, and we can’t find the sum. The zeta function, however, attempts to generalize this equation for any value of z.

The value of these sums have meaning in a particular mathematical context. It is as if you encountered the imaginary number i = \sqrt{-1}, and said that the result is meaningless, since square roots are supposed to only return positive numbers. But in math involving the complex plane, it is quite meaningful, and enjoys actual use in the design of integrated circuits, for instance.

To see how Ramanujan encountered -1/12 as the sum of 1 + 2 + 3 + …, you can do normal summation, pretending that the series we are about to encounter always converge (and none of the following do):

\displaystyle \frac{1}{1 + 1} = 1 - 1 + 1 - 1 + 1 - 1 + ... = \frac{1}{2}

As you calculate partial sums, you get 1, 0, 1, 0, 1, …, and this never settles on any single value. This series is divergent. The 1/2 “sum” can be seen as an average of 0 and 1, and this actually is called a Cesaro sum.

Now suppose we squared this:

\displaystyle \left(\frac{1}{1 + 1}\right)^2 = (1 - 1 + 1 - 1 + 1 - 1 + ...)^2 = 1 - 2 + 3 - 4 + ... = \frac{1}{4}

The sum 1 – 2 + 3 – 4 … is the product of  the square of (1 - 1 + 1 - 1 + 1 ...)^2, which can be seen by using a grid to help you square them:

× 1 -1 1 -1 1
1 1 -1 1 -1 1
-1 -1 1 -1 1 1
1 1 -1 1 -1 1
-1 -1 1 -1 1 1
1 1 -1 1 -1 1

Then, you may add numbers from that table belonging to the same diagonal. Above, they happen to be the same colour. The 1’s and -1’s in gray are incomplete diagonals due to the limitations of a finite table.

You get: 1 – 2 + 3 – 4 + 5 – … = \displaystyle \left(\frac{1}{2}\right)^2 = \frac{1}{4}, which we will refer to as S_2.

Now, let’s get back to the original “sum”: S_1 = 1 + 2 + 3 + 4 + 5 + ... = -1/12. We can re-generate S_2 using only S_1 as follows:

\begin{aligned}  S_1   & = & 1 + & 2 + & 3 + & 4 + & 5 + ... \\  4S_1 & = &    &    4  +&        & 8  + &  ... \\  S_1 - 4S_1 & = & 1 - & 2 + & 3 -  &  4 + & 5 - ...  \end{aligned}

… and finally, using our finding that S2 = 1/4, we arrive at the original incredible sum:

\begin{aligned}  -3S_1 & = & \frac{1}{4} \\  S_1 & = & \frac{-1}{12}  \end{aligned}

The sum is verified by the Riemann Zeta function for \zeta(-1) .

The only story I am aware of where giving away the “answer” doesn’t matter.

The feeling I get when I see a result like this is like when reading the Douglas Adams book Hitchhiker’s Guide To The Galaxy, and then being told by their whizzbang computer that the answer to life, the universe and everything was 42. You feel no more enlightened than before you asked the question. But then that is because the answer is not understood. And for that matter, even the question may need some work.

Mathematicians such as Euler and Ramanujan had endeavoured to unlock the mysteries of these strange results.

We know that \zeta(z) works best for z > 1. For all z < 1 (especially negative numbers), \zeta(z) does not return a direct value, but instead the mathematician needs to base a conjecture of what the value could be, based on analytical continuation. It turns out, this is far from guesswork since, for any negative z in the set of complex numbers, there is always exactly one answer that analytic continuation ever offers. \zeta(-1) = -1/12 is the result when z = -1 .

The zeta function also equals zero in strange places, such as when z is a negative even integer. The reader is reminded that the set of complex numbers is utterly vast, subsuming the entire set of real numbers as a subset of the complex numbers. This is because a complex number C is defined as C = a + bi, where a and b belong to the set of real numbers, and i, once again, is \sqrt{-1} . If you allow b = 0 , then C is a real number.

According to Riemann’s Hypothesis, the other set of zeroes for the zeta function lie entirely in the set of complex numbers where C = \frac{1}{2} + bi , for some value of b. In other words, all other zeroes for the Riemann zeta function are of the form \zeta\left(\frac{1}{2} + bi\right) for some real number b.

Now, this is a hypothesis, which hasn’t been proved wrong yet, but it also hasn’t been proved to be correct generally. The Clay Mathematics Institute has made this one of their millenium prize problems, offering one million dollars to anyone who can solve it. If this is proven, other connected conjectures are proven along the way, such as the Goldbach Conjecture, and the Twin Prime Conjecture.

The locations of the zeroes of the zeta function appear to bear some relationship to the number of primes in an arithmetic progression with a fixed difference k. Proving Riemann will also validate the zeta function as useful for studying prime numbers, as had been done by Leonard Euler.

Update on Tex editors

Nearly three years ago, I wrote about a comparison of LaTeX editors. Soon after, I began to use a third editor which, if you are a latex expert, you almost certaintly would have heard about, and are probably in fact using TeXStudio, an editor that has been around for close to a decade, but never appeared to show up on Linux installation packages. The editors that showed up, at least for me, were LyX and TeXmacs.

TeXstudio, once I discovered it, I installed it everywhere I could: on my Windows 10 and 7 machines, on my Linux installations, and even on Cygwin, even though they already had a Windows installation. To this day I have not seen any difference in output or functionality. All invocations of TeXstudio require a lot of time and packages for an installation of enough features.

This is TeXstudio, with the horizontal toolbars shown, along with part of the workspace. There are two vertical toolbars there, also partially shown.

First thing’s first: the editor. In LyX and TeXmacs, I needed to bail out of the editor, and export the code to LaTeX whenever I needed to do any serious equation editing or table editing or the like. In contrast, TeXstudio leaves me with no reason to ever leave the editor. First of all, the editor allows for native latex code to be entered. If there are pieces of Latex code that you don’t know, or have a fuzzy knowledge about, there is probably an icon or menu item that covers it. For document formatting, a menu item leads to a form dialog where you can fill in the form with sensible information pertaining to your particular document, default font size, paper size, margins, and so on. The ouput of this dialog is the preamble section to the LaTeX source file. To the rest of that source file, you add your document and formatting codes.  It is a kind of “notepad” for LaTeX, with syntax highlighting and shortcut buttons, menus and dialogs. It comes close to being WYSIWYG, in that “compiling” the code and pressing  the green “play” button brings up a window with the output of the existing code you are editing. It is not a live update, but it saves you the agony of saving, going on the command line compiling the code, and viewing in seeminly endless cycles. Now you can view the formatted document at the press of the play button.

A brief note on Pythagorean Triples

And I decided today to share what I learned about an algorithm for generating Pythagorean triples for any m and n, where  m, n \in Z.

A Pythagorean triple are any three whole numbers which satisfy the equation a^2 + b^2 = c^2. For any two integers  m and  n, let a = m^2 - n^2; b = 2 m n; and c = m^2 - n^2, and you will obtain a solution to the relation a^2 + b^2 = c^2.

It is therefore not that hard, if we allow m and n to be any numbers from 1 to any upper limit you like, to write a computer program to generate the first  x Pythagorean triples, allowing for negative values for a or b.

What the Golden Ratio has to do with The Thomas Crown Affair

by Ben Sparks, . Click on the illustration to see and use this app.

There is a Geogebra app written by Ben Sparks which can run on your browser. There are many facets to this app, such as an animation of “circles within circles”. When this app runs (see the screenshot on your left), the dark points appear to move together in circles, but are really moving in straight line segments along the green paths. The red point A is the only point actually moving in a circle. The number of dark points can be controlled. When reduced to two points, the positions of them resemble the sine and cosine of angles if the red point was on the terminal arm of an angle in standard position. A circle of dark points can be formed from the points of intersection between a perpendicular passing through A and any line.

Mandlebrot painter, showing the mandlebrot set you are to produce a painting of

There was another one to do with a Mandlebrot set and a complex coordinate plane, even offering a “painter” which colors the canvas from black to blue when the iteration forming the spiral goes from stable to unstable, or from a cohesive spiral to one whose points are scattered as you drag a point C with your mouse over the coordinate plane. The points converge on a single point at the origin.

When r is rational, it doesn’t lead to much of a spiral. Lyric snippet on the right.

The last and my favourite, is one called a “sunflower spiral”. Apart from checkboxes, a text box for numeric input, and a “start/stop” button to control the animation, there is another checkbox which says “show lyrics”. They are the lyrics to the 1968 hit song “The Windmills of Your Mind”, which first appeared as the theme to the movie The Thomas Crown Affair, and sung by Noel Harrisson, and won an Academy Award for best original song. I won’t bore you with the lengthy list of vocalists who have covered it since, but I can provide a link if you really want to know that and other details.

The idea here is, imagine a flower with many, many seeds, like a sunflower. As it distributes more and more seeds, it must do so from the centre, pushing the seeds it has already deployed, more and more to the outside. Seeds thrive when they are further apart, so that they may take advantage of greater food availability.

Something is definitely starting to look different here …

This app appears to mimic a flower which distributes its “seeds”, symbolized as small circles, based on the distance from the centre and the amount of rotation based on the desired amount of seeds per turn. The number of turns has to be a number between 0 and 1. So, if you want 5 seeds per turn, seeds are distributed every 1/5 of a turn, and so you enter r = 0.2 in the text box. However, this means that, rather than spirals forming, you get spokes, as in the illustration above. However if you let it run for a bit, it does a fine iteration to six decimals, and you begin to see spirals bending, disappearing and re-forming, as in the illustration to the left, with a number like 0.206270. This is still a rational number, since the decimal terminates.

Notice that the centre of the “windmill” still has “spokes”. That might still be because 0.206270 is still close to 1/5, or 0.2. The outer “seeds” seem to arrange themselves in such a way that any one of them are members of at least two kinds of spirals, criss-crossing each other in opposing directions.

On the left, the irrational number [latex]\pi-3[/latex]. On the right, the irrational number [latex]1/\pi[/latex].

\pi is another number thought to be highly irrational. Not irrational enough to scatter the seeds, as they fall in an orderly fashion and too close together for both \pi - 3 (above left) and 1/\pi (above right). Strangely, the spiral on the right has 7 “spokes”, and the one on the left has 22 “spokes”. If you recall your high school teacher telling you that an approximation for \pi is \frac{22}{7}, I am not sure if that has anything to do with it.

“Windmills” created using Euler’s constant.

Another candidate is Euler’s constant, e. I tried e - 2 (right) and 1/e (left), and both looked somewhat more satisfying. They still had distinct spirals somewhere in the seed distribution. When I say that the spirals are distinct/not distinct, I mean that the eye is drawn less and less to one particular spiral. But the seeds are overlapping a lot less, though there is still some overlap.

This one is based on the square root of 2.

The irrational number \sqrt{2} can be applied, and here, it is applied as 1/\sqrt{2} (left), and \sqrt{2} - 1 (right). This seems to be the best so far, as the spirals get less distinct, and the seeds appear to be spread further apart still, not seeming to touch anywhere.

“Windmill” based on the golden ratio minus one, or its reciprocal (same number).

For the golden ratio, this time the decimal was simply stripped from the number. Their button says \frac{\sqrt{5}-1}{2}, but this is the same as \Phi - 1 = \frac{\sqrt{5}+1}{2}-1 = \frac{1}{\Phi}=0.61803398875, oddly enough. The “seeds” appear to have the best distribution. I had the feeling this is true of any number \frac{\sqrt{n}+1}{2}, where n is a prime number, or at least a number that is not a perfect square. I had no luck, however, after trying 2, 3, 6, 7, and 11, and using the decimal or taking the reciprocal. Of course, the metallic means have numerical properties similar to the Golden Ratio, and two others were tried.

The reciprocal of the Silver Ratio, \delta_S=\frac{1}{\sqrt{2}+1}=\sqrt{2}-1 was already tried, and worked well (see above). The Bronze Ratio, \frac{3+\sqrt{13}}{2}-3=0.302775638, led to less satisfactory results.  Metallic means follow the formula {\large\frac{n+\sqrt{n^2+4}}{2}}, for any positive whole number n.

Whatever happened to the conic sections: Parabolas

Most high school parabolas these days are either concave up or concave down.

I don’t know about anywhere else, but in our school district, any parabola that is not solvable by the quadratic formula is an endangered species. Specifically, I am mourning the loss of parabolas whose directrix is not parallel to the x-axis. The ones that are parallel to the x-axis are such a mundane part of the curriculum that we never discuss the existence of a focus or a directrix.

Parabolas can open up in any direction, not just up or down. And they all possess a focus and a directrix. As an example, suppose the focus of the parabola was at the origin, and the directrix was the line -x - y = 2, or y= -x-2 if you prefer slope-intercept form. This ought to lead to a single parabola as a result: x^2 - 2xy + y^2 -4x - 4y = 4. Parabolas like these cannot be resolved to familiar equations of the form of y= ax^2 + bx + c, largely due to the difficulty in separating x from y.

How do you say this? A “non-functioning” parabola? Malfunctioning?

I have gotten used to saying to my students that all polynomial functions of x have a domain in all real numbers. This works because I am only talking about functions. But for relations like x^2 - 2xy + y^2 -4x - 4y = 4, both domain and range have a restriction. The parabola looks like the illustration to the right. This relation is not a function, because  1) x and y can’t be separated, and 2) you can pass a vertical line through more than one point on its graph – that is, one value of x generates two values of y. Other patterns we take for granted are also broken: the vertex is not a local extrema anymore. We require implicit differentiation to obtain the local extrema: \frac{dy}{dx} = \frac{-x+y+2}{-x+y-2} = 0 , which boils down to y = x-2. From the point of intersection between this line and the parabola, we find it will have an absolute minimum at (1, -1). The range, then, is y \ge -1.

The vertex is located at (-0.5, -0.5).

The domain is, similarly, x \ge -1.

The meaning of i^i

Imaginary numbers, like most things at the peripherals of our grasp of reality, interest me, since they appear to have their own rules at times. There was a video blog some time ago that tried to reckon with \large i^i and considered what it equalled.

One calculation I observed came from De Moivre’s identity, \large e^{i\theta} = \cos\theta + i \sin\theta. If you let \theta = \frac{\pi}{2}, you get e^{i\frac{\pi}{2}} = 0 + i = i.

Now raising both sides of the equation e^{i\frac{\pi}{2}} = i to the power i, you obtain the result: e^{i\cdot i\frac{\pi}{2}} = i^i, and, since i\cdot i = i^2 = -1, you get: e^{\frac{-\pi}{2}} = i^i.

This is a notable equation because the left hand side are all real numbers, and the right hand side are all complex. The result of the right-hand side is about 0.20788.

But did this crack that mystery? Well, if you consider the origin of the derivation was from De Moivre’s identity, then it would just compel one to think that not only is \frac{\pi}{2} a solution, but all angles co-terminal to it. i^i therefore has infinitely many answers if we are to rely on De Moivre’s Theorem.

Representing the Quartic Formula

I have used various graphics packages to hunt for a quartic formula. Over the years I had settled for a formula that is one order down, the cubic formula. For a polynomial of the form f(x) = ax^3 + bx^2 + cx + d, all real solutions may be obtained by the formulae:

These formulae are relatively easy to find with a math package like Maple. See how the formula is quite a lot more complex when compared with the quadratic formula.

The formula for finding all real solutions to an order 4 polynomial has been elusive, however. Maple simply gives up and doesn’t bother. There is, however, Mathematica, which can come up with a quartic formula. I have a screenshot of all four solutions to ax^4 + bx^3 + cx^2 + dx + e=0, two parts at a time from the Mathematica output: (to view, you need to right click on the image and select “View image” or something similar on your browser)

The second part of this is:

Thank God Neils Abel verified that there is no such formula polynomials of order 5 and above. Another blogger went to the trouble of writing all four formulae in LaTeX, and came up with:


9×9 Magic Squares by the Lo Shu Method

The Lo Shu method generated the only 3×3 magic square that exists (rotations and reversals of the same 3×3 arrangement notwithstanding), and was the first magic square known to be discovered by humans, over 3000 years ago in China. Because of the one magic square it yields, utilizing the Lo Shu method recursively for 9×9 can only generate exactly one 9×9 magic square. A casual glance on Google will tell you that there are many more 9×9 squares out there that break the patterns that we are about to explore.

My preference has always been to discuss algorithms for magic squares that are “high-yielding”, or lead to many distinct magic squares, such as 5×5 (14,400 squares), and 7×7 (over 25 million squares). Why spend an article discussing the one possible square generated by the Lo Shu algorithm? I think this is because this has a great many unique patterns, and there are many “little” squares, each with their own magic numbers. It is not pan-magic in the normal way, but it seems to have multiple magical properties nonetheless.

The basic Lo Shu square begins with an ordered arrangement of the digits 1-9 in a 3×3 matrix:

                 1  2  3
                 4  5  6
                 7  8  9

Switch each corner number with the number kitty-corner to it:

                9  2  7
                4  5  6
                3  8  1

Then, imagine pressing the 9 to go between the 4 and 2, to create a new row, and doing the same with the 1 in placing it between the 8 and the 6. The diagonal 3  5  7 becomes the middle row of the new square. It would look thus:

                4  9  2
                3  5  7
                8  1  6

The result is a 3×3 square that is magic, and is the only 3×3 magic square of sequential digits 1-9 that exists. Beware of reflections and rotations of these squares, since they are still the same square.

The reason for showing the construction of the 3×3 square is because constructing the 9×9 square follows a strangely identical pattern.

The 9×9 Lo Shu square is built on the same pattern

The same principle that created the 3×3 square can be used to make a 9×9 square. The drawback is that this method will again only yield one square. In truth, there are thousands of 9×9 squares possible. You begin with the numbers 1 to 81 in sequence in a 9×9 array:

1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18
19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81

Let’s look at the first column. We make a 3×3 array out of this, starting by placing the numbers in numerical order in the same manner done with the numbers 1 to 9 earlier:

                         1   10   19
                        28   37   46
                        55   64   73

Then, we switch the corner numbers again:

                       73   10   55
                       28   37   46
                       19   64    1

Form new rows as described earlier, resulting in the top being 28  73  10, and the bottom being 64  1  46, with 19  37  55 being the middle row:

                       28   73   10
                       19   37   55
                       64    1   46

The result is a 3×3 sub-square that itself is magic. You can repeat this for the second column:

                       29   74   11
                       20   38   56
                       65    2   47

But then you would notice that each cell in this new 3×3 sub-square is one more than each corresponding cell in the previous 3×3 sub-square. Thus, the remaining sub-squares can be obtained by adding 1 to the previous sub-square when doing each of the columns in order from the original 9×9 square. You get the following intermediate 9×9 square:

28 73 10 29 74 11 30 75 12
19 37 55 20 38 56 21 39 57
64 1 46 65 2 47 66 3 48
31 76 13 32 77 14 33 78 15
22 40 58 23 41 59 24 42 60
67 4 49 68 5 50 69 6 51
34 79 16 35 80 17 36 81 18
25 43 61 26 44 62 27 45 63
70 7 52 71 8 53 72 9 54

OK, so we are not quite there yet. The light grey and white patterns denote the nine 3×3 sub-squares that we were just discussing. But in the manner done for the initial 3×3 squares, we need to:

  1. Switch out the corner 3×3 sub-squares, as shown below.
    36 81 18 29 74 11 34 79 16
    27 45 63 20 38 56 25 43 61
    72 9 54 65 2 47 70 7 52
    31 76 13 32 77 14 33 78 15
    22 40 58 23 41 59 24 42 60
    67 4 49 68 5 50 69 6 51
    30 75 12 35 80 17 28 73 10
    21 39 57 26 44 62 19 37 55
    66 3 48 71 8 53 64 1 46
  2. Finally, make the magic square from the sub-squares going diagonally. That is, make a top row of the three sub-squares in the top left corner; then make a bottom row of the three sub-squares in the bottom right corner. The middle rows of the 9×9 square will consist of the three sub-squares extending from the bottom left to the top right. In this manner, we would have formed the magic square in the precise pattern that we used for individual numbers when we did the original 3×3 square. Below is the square, revelaling the magic number totals on the rows, columns, and diagonals:
    31 76 13 36 81 18 29 74 11 369
    22 40 58 27 45 63 20 38 56 369
    67 4 49 72 9 54 65 2 47 369
    30 75 12 32 77 14 34 79 16 369
    21 39 57 23 41 59 25 43 61 369
    66 3 48 68 5 50 70 7 52 369
    35 80 17 28 73 10 33 78 15 369
    26 44 62 19 37 55 24 42 60 369
    71 8 53 64 1 46 69 6 51 369
    369 369 369 369 369 369 369 369 369 369 369

The feature of this square that intrigued me was in the way the algorithm was scalable from 3×3 to 9×9. That made it easy to learn.

Another University Exam From Hell …

The list of fictional questions to university exams have been around for a long time. Such as:

Epistemology: Trace the development of human thought from 3000 BC to today. Compare and contrast with any other kind of thought.

Engineering: You have the disassembled parts of an AK-47 assault rifle in front of you. Also in front of you is an assembly manual, written in Navajo. In 15 minutes, a hungry Bengal tiger will be let into the exam room. Take whatever action you feel is appropriate. Be prepared to justify your decision.

Medicine: You have a scalpel, a clean rag, and a bottle of scotch. Remove your appendix. Do not suture until work is inspected.

Philosophy: Why?

The first three questions are bogus. But as the urban legend has it, the person who scored perfect on the last question answered with “Why not?”, signed his (or her) name to it and handed in his (or her) two-word essay to the examiner and left the room.

Here is another philosphy question, rumored to have been asked, and this is a new one on me:

Philosophy: “If this is a question, then answer it.”

As the legend goes, there was the usual reaction of heads hitting the desks, pages of paper being filled out with their perilous struggles against whether they were actually being asked a question or not. The highest mark in the class went to the one who handed in this 8-word essay: “If this is an answer, then mark it.”