## Wednesday, 19 November 2014

### Perfect numbers and Mersenne Primes

“One would be hard put to find a set of whole numbers with a more fascinating history and more elegant properties surrounded by greater depths of mystery—and more totally useless—than the perfect numbers.”
—Martin Gardner

While it is true that perfect numbers may not be as useful or evident in our environment as the Fibonacci series discussed last time, in terms of enigma and unresolved mysteries, nothing can probably come close to the magical perfect numbers. But first of all, what is a perfect number? What distinguishes a perfect number from it’s “imperfect” counterparts?
A number is said to be perfect if the sum of it’s proper divisors (excluding itself) is equal to the number itself. This sum is also called the “aliquot sum”. This statement is equivalent to the statement that the sum of the divisors of a perfect number and the perfect number is equal to two times the perfect number. Reading this definition at first might make finding perfect numbers sound like a huge ordeal. However, it is here that the true elegance of these numbers is shown. Before delving into the technicalities of perfect numbers, let us first explore the first few perfect numbers.

1.    6; 6 = 1 + 2 +3
2.   28; 28 = 1 + 2 + 4 + 7 + 14
3.   496; 496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248

These are the first 3 prime numbers. Observe that they are even numbers. In fact, it has been found that if an odd perfect number does exist, it must be larger than 101500 !

Euclid proved that if 2p-1 is a prime, then, (2p-1)(2p-1) is an even prime number. The prime number 2p-1  (where p is a prime) belongs to a special category of numbers called the Mersenne Primes, named after the monk Marin Mersenne. 2p-1 is a prime if and only if p is a prime; the converse, however, doesn’t hold true. Mersenne Primes and perfect numbers are closely related because each Mersenne Prime produces one even perfect number. This fact was proven by Leonhard Euler who showed that the formula (2p-1)(2p-1) will give all the even perfect numbers. The Great Internet Mersenne Prime Search (GIMPS) is a special program in which people use open software to find Mersenne Primes. The largest known prime as of April 2014 is 257,885,161  1 (or M57,885,161 in short). This is the 48th Mersenne Prime. Because we know 48 Mersenne Primes, we also know 48 even perfect numbers, the largest of which is 257885160 × (257885161  1) with 34,850,340 digits(!); corresponding to the 48th Mersenne Prime that we talked about in the above line.

The main two problems concerning perfect numbers that exist in the world of Math are- “Are there infinitely many perfect numbers?” and “Are there any odd perfect numbers?” The first question can also be extended to question the number of Mersenne Primes.

Now that the technicalities of perfect numbers are clear, let’s dive into some cool facts about perfect numbers.

1.    28 is the only even perfect number that can be represented as a sum of two cubes (27 and 1).

2.   No perfect number is a perfect square. So, the number of proper divisors of a perfect number (including the number itself) is always even.

3.   The sum of the reciprocals of the proper divisors of a perfect number (including the number itself) is 2. This follows directly from the fact the sum of the proper divisors of a perfect number is 2 times the perfect number.

4.   In base 10 representation, every even perfect number ends in either 6, or 28.

5.   The nth  triangular number is the sum of “n” natural numbers i.e (n(n+1))/2. Each even perfect number is the (2p-1)th triangular number; the sum of (2p-1) natural numbers.

6.   The binary representation of even perfect numbers is extremely special owing to their general formula. Any even perfect number (2p-1)(2p-1), in binary can be presented as a string of “p” ones, followed by “p-1” zeros. For example, (6)10 == (110)2 and (28)10 == (11100)2 . This also shows that the digital root of an even perfect number in binary representation will always be a prime (p is a prime). This makes even perfect numbers qualify for a special category of numbers called Pernicious numbers. A number is said to be Pernicious if the digital root (or digit sum) of it’s binary representation is a prime number.

7.   The difference of every even perfect number and the corresponding Mersenne prime is always divisible by the prime number involved in the formation of the Mersenne Prime. This means that (2p-1)(2p-1) - (2p-1) is always divisible by p.

Even though perfect numbers aren’t too useful in the real world, the little wonderful facts that they hide add to their charm. Studying them just for the sake of Math is what makes these unique numbers even more fun!

## Tuesday, 14 October 2014

### The magical world of the Fibonacci sequence and the Golden Ratio.

The Fibonacci sequence is quite simply the most famous and elegant (and also our favorite!) number sequence in Mathematics. But what exactly is it?

The Fibonacci sequence is a sequence (not a series; a series is a summation of the sequence) of numbers which follows a specific linear recurrence equation. Don’t worry if that sounds complicated. A linear recurrence equation is an equation that expresses a particular number of a series as a linear combination of the other numbers of the sequence (or in more formal language, as a linear combination of first degree polynomials of the sequence).

For the Fibonacci sequence, if F(n) is the nth term of the sequence, then the linear recurrence equation is F(n) = F(n-1) + F(n-2) for n >= 2. In modern terminology, F(0) is considered as 0, however in old times, F (1) was the starting point of the sequence and F (1) was equal to 1. We will use the modern convention for our article where F(0) = 0 and F(1) = 1. In simpler words, the nth term in the sequence is equal to the sum of the two terms preceding it. Using the recurrence formula, we find that the terms are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 … . Note that the sequence doesn't end at 377, it goes on and on. Now one might ask just what’ so special about this sequence as compared to just any other ordinary sequence? We will delve into that too but first something about the origin of the sequence.

Even though the sequence is named after the Italian mathematician Fibonacci (Leonardo Binacci), the sequence was discovered in India by various people in different time periods. There are several stories about the sequence’s origin. However the fact that it originated in India is undisputed. Fibonacci introduced the sequence to the western world (Europe) via his extremely famous book Liber Abaci and the concept was extremely well received by the Europeans.
Fibonacci presented the series in the form of a hypothetical problem – ‘Assuming that a newly born pair of rabbits, one male, one female, are put in a field; rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits; rabbits never die and a mating pair always produces one new pair (one male, one female) every month from the second month on. The puzzle that Fibonacci posed was: how many pairs will there be in one year?

After solving the problem, it turns out that the number of pairs of rabbits each month is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55.. i.e the Fibonacci sequence!

Now that we have covered the history of this sequence, let’s get into the main stuff. What makes the Fibonacci sequence the ‘celebrity’ of the Mathematical world?

First of all, a little exercise for you. Perform the operation F(n+1) / F(n) for n >= 0. This means divide the (n + 1)th Fibonacci term with the (n)th  Fibonacci term. You will observe that as n keeps on getting larger, the ratio starts tending to 1.618. This isn’t just any random number; this is the Golden Ratio, also represented by the Greek letter φ (phi). Mathematically, two numbers are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. The Golden Ratio has immense historical significance. Many famous pieces of architecture have been built using the principle of the Golden Ratio. It is said that objects following the Golden Ratio are more elegant and aesthetically pleasing. This seemingly insignificant number is pretty much everywhere! Just look it up and you will find a wealth of information about it.
Besides it’s relation with the Golden Ratio, the sequence hides in it a wealth of information that make it even more elegant and magical.

Here are some interesting observations (some of them we discovered on our own):

1.       (F(n))^2 + (F(n+1))^2 = F(2n + 1)

2.      F(0) + F(1)  + F(2)  + F(3)  + …. F(n) = F(n+2)  - 1

3.      (F(0))^2 + (F(1))^2   + (F(2))^2 + (F(3))^2 + …. (F(n))^2  = F(n) F(n+1)

4.      (F(n))^3 + (F(n+1))^3  = F(3n) + (n-2)^3  (For n > 2)

5.      The digital root of the sequence starts repeating after 24 entries and the pattern that it follows is 1 1 2 3 5 8 4 3 7 1 8 9 8 8 7 6 4 1 5 6 2 8 1 9. We didn't calculate the digital roots by hand. That will be too tedious! Using a simple Java program can do the trick for you.

These are just some of the patterns. You can find many more by just sitting down and pondering over the sequence. That’s the beauty of the Fibonacci sequence. You never know what you will find!

## Sunday, 27 July 2014

### ‘Mathematics’-Is it really that scary?

Mathematics - It is to the typical ‘Non Mathematical lover’ person what The Joker is to the Batman, what Dr Octopus is to Spiderman, what a positron is to an electron. What is it about Math that puts people off and elicits such contempt and anger? Is it the ‘exotic’ and ‘creepy’ style of representation or the seemingly abstract and intangible nature of this beautiful subject that makes people wary of it? And is it really justified? We believe that this fear and to be more specific, mathematical anxiety is a cause of multiple external factors exacerbated further by the mental block that students and in general, people have towards this subject. Much of this anxiety happens in the classroom due to the lack of consideration of different learning styles of students. Teachers, as representatives of this subject must take special care to re-engineer their teaching style in order to present Math in a way which reduces anxiety and develops an inquisitiveness and curiosity. But teachers too are limited due to some reasons and even if they want to, can’t go beyond the prescribed curriculum.

This is just one of the factors which if amended, can abate the serious issue of ‘Mathematical Anxiety’. We have discussed this topic at length in a video episode. You can watch that episode here- Episode Link

## Sunday, 29 September 2013

### A Day for every Date- beat the calendar!

One of the most impressive feats of mental calculation: calculate the day of any random date in your head. While it may sound extremely tough, if you are friendly enough with numbers, we reckon you can calculate days within 10 seconds! YES! All you need to do is remember some numbers and tricks and you will be ready.

Each day of the week is assigned a number-
Monday-1
Tuesday-2
Wednesday-3
Thursday-4
Friday-5
Saturday-6
Sunday-0/7

This list is pretty easy to remember and follows a standard chronological order. NOTE that the numbers are 'wrapped' around the number 7; this modulo behavior is extremely important for this trick to work.

Next, we give each month a number. Now, this list doesnt follow a logical order and we recommend that you develop your own method to remember this list-

January-6 (5 for leap years)
February-2 (1 for leap years)
March-2
April-5
May-0
June-3
July-5
August-1
September-4
October-6
November-2
December-4

Once you have learnt these month codes, you can progress to the all important year codes. Just like months, every year has its own code but remembering year codes is an ordeal in itself and nearly impossible (unless you have an eidetic memory!). Fortunately, there is an efficient way to calculate year codes mentally. We shall demonstrate the method below-
We want to figure out the year code for 2005. Now, 2005 lies in the 21st century and ends with the number 5. We divide 5 with 4 and calculate the quotient (ignore the remainder), which in this case is 1. Then we add the obtained quotient to the last digit. 5+1 = 6. 6 is the year code for 2005.
Lets find the year code for 2014. 2014 ends with 14. When we divide 14 with 4, the quotient is 3. Adding 3 and 14 we get 17. Next, we find which multiple of 7 that is smaller than 17 is closest to 17. In this case the multiple is 14. Subtract 14 from 17 to get 3; the year code for 2014

The above method works for only 21st century years, for 20th century years, we have to add 1 to the final code.
1996- 1996 lies in the 20th century and ends with 96. The quotient when we divide 96 and 4 is 24. Add 24 and 96 to obtain 120. The closest multiple of 7 smaller than 120 is 119. 120-199=1. 1 is not the year code. We need to add 1 because 1996 lies in the 20th century. 1+1+2. So, the year code for 1996 is 2, and not 1.

Just like for 20th century years, we add 1; for 19th century years we add 3 and for 18th century years we add 5. The good thing about our calendars is that years are repeated after 400 years, so 18th century and 22nd century calendars are the same.

NOTE- Year codes will always lie between 0 and 6.

Once you have mastered the trick for calculating year codes, you can proceed to the final step, calculating the day! We shall work out two examples-

1) 2nd March 1997:
The month code is 2
Calculate the year code- you will obtain 3
The date- 2
Now add the three numbers, you will get 7. Now, 7 is our day code which represents Sunday. So, 2nd March 1997 was a Sunday

2) 22nd July 2222:
The month code is 5
Calculate the year code- you will obtain 2 (simply obtain the year code for 1822)
The date-22
Now add the three numbers, you will get 29. Now, 29 is greater than 7 and needs to be reduced. We will now subtract the multiple of 7 closest to 29 but smaller than it from 29, which in this case is 28. 29-28=1. 1 is the day code for Monday. So, 22nd July 2222 will be a Monday.

We hope that you have now gained a clear idea of how to calculate days. If you need any assistance feel free to contact us via our blog.