Remarkably in around 2004, Richard Sabey gave an extremely accurate approximation to the Euler number,

which uses the digits 1 to 9 exactly once and it is accurate to around digits.

]]>First of all, we need to know what a triangular number (aka triangle number) is. A triangular number is the number count of dots which forms an equilateral triangle such as the diagram below.

Or basically the *n*th triangular number is the sum of the natural numbers from 1 to *n*. Some people will define the zeroth triangular number as zero. And the formula for the *n*th triangular number can be easily defined as the following.

An interesting fact about triangular number is that the number 666 is one of them. Why? because 666 = 2 **·** 3 **·** 3 **·** 37 = 18 **·** 37. which is 36 **·** 37 / 2, so 666 is the 36th triangular number. And if you switch the number 36 to 63. The 63rd triangular number is 2016. That’s why I want to write something about triangular number three years ago but I didn’t have the time back then too busy taking care of my baby girl. Anyway let’s go back to what I want to do today. I want to find two triangular numbers such that one is twice another one. Since the devil number 666 is one of them, let’s list out all triangular numbers up to 666.

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, …

At first glance, the pair of 3 and 6 stands out right away. Now the question is can we find another pair? Without much trouble, 105 and 210 can be picked out quite easily from the above list. Can we find more? Consider the following. For natural number *m* and *n*,

Multiplied both sides by 8,

Let and , we have

which is a classical Pell’s equation of the form . Since it is negative one, some people prefer to call it the negative Pell’s equation or the anti-Pell’s equation. To solve this equation, we can use continued fraction. I am not going to explain what continued fraction is because that will be too long and one can always find the explanation on Wikipedia or in any elementary number theory books. Maybe later when I have the mood I will write something on continued fraction coz I think continued fraction is a better way to represent a real number than the decimal expansion representation we are normally using. For instance, the number 1/3 can not be expressed as a terminating decimal but in continued fraction it can be written as [0; 3]. For irrational number such as root 2, it is approximately equal to 1.414213562… which I need to use a calculator to evaluate plus the decimals are non-repeating. But root 2 can be written as an exact form by using continued fraction with a repeating pattern [1;2,2,2,2,2, …].

Anyway let me solve the anti-Pell’s equation

First I need to find the continued fraction of root 2.

Note that continued fraction is denoted as

So in our case here,

Next, we can find the kth convergent of root 2. The kth convergent of the continued fraction has the value

and the values of the numerators and denominators can be defined as follows.

It is straightforward to prove this by math induction.

To proceed further, we need the following theorem.

**Theorem.** Let be a positive integer that is not a perfect square. Let denote the *k*th convergent of the simple continued fraction of . Let be the period length of this continued fraction. Then, when is even, the positive solutions of the Pell’s equation are , and the anti-Pell’s equation has no solution. When is odd, the positive solutions of the Pell’s equation are , and the solutions of the anti-Pell’s equation are .

The proof is quite long so I am too lazy to type them all out.

Let me list out the numerators and the denominators of the kth convergent of the infinite simple continued fraction of for by using the recursive formula for and defined earlier.

Since , the period *n* = 1 is odd, then by the theorem, we have the index for *p* and *q* being equal to which are 0, 2, 4, 6, 8, …, all the even convergents. So the solutions are

Since and , then and , hence,

The first pair (0,0) implies that zeroth triangular number is twice the zeroth triangular number (if you accept zero as the zeroth triangular number). And the rest are:

(3, 2) implies that 3rd triangular number is twice the 2nd triangular number.

(20, 14) implies that 20th triangular number is twice the 14th triangular number.

(119, 84) implies that 119th triangular number is twice the 84th triangular number.

(696, 492) implies that 696th triangular number is twice the 492nd triangular number.

etc.

In conclusion, since is irrational and the infinite simple continued fraction of is periodic, there are infinitely many *k*th convergents of . Therefore, there are infinitely many pairs of triangular numbers that one is twice another one.

QED.

]]>It isn’t difficult to verify 673 a prime number. Now I have used the digits 1 and 2 and there are 7 left, they are 3, 4, 5, 6, 7, 8, 9. After a while of trying out different products, I can’t find 673 out of the remaining digits. So I try factorials and I found 6! = 720 is pretty close to 673, a difference of only 47. And 4 times 5 is 20 so I have 27 left to consider, which is great coz I know 7 + 8 + 9 = 3 times 8 which is 24 and with the remaining digit 3 I am done!

HAPPY NEW YEAR !!!

**Remark**

Matt Parker has a YouTube video on 2019 and I think it is amazing that

and here is the video

]]>For example, if a person invested a certain amount of money at a fixed annual interest rate of 9%, the Rule of 72 will give around 72 / 9 = 8 years for the investment to be doubled. Where the actual calculation should be log(2) / log(1.09) = 8.043, but it’s pretty damn close.

Let’s look at another example, you deposit $100 into a saving account with 4% p.a., the Rule of 72 says it will take about 72 / 4 = 18 years for your money to become $200. The actual calculation should be log(2) / log(1.04) = 17.67, again it’s close enough.

The Rule of 72 is very useful in situation like when calculators aren’t around because there is no way I can calculate log(2) / log(1.04) in my head but I can manage to compute 72 / 4 mentally.

The reason that this rule works is because of the following:

First, we are trying to find the linear approximation of .

Let , then first order taylor series around would be

hence,

or

So, becomes

The number 72 is chosen because in fact it is close to 69.31 and 72 has 12 divisors that is considered a lot. 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72 divide 72.

]]>**Euclid-Euler Theorem.** For , if is prime, then is perfect. And every even perfect number is of this form.

**Proof.** Denote the sum of all divisors function as . Let be Mersenne Prime and be an integer. Since and is multiplicative, we then have

Since the factors of are and is Mersenne prime,

And this is exactly the definition of a perfect number.

To prove the converse, assume *n* is an even perfect number such as where *a* and *k* are positive integers and . Since , we have

Since *n* is perfect, then

Hence, , but , so , which means for some integer *b*. Then equation (1) becomes

Since and are both divisors of , we have

This forces the inequality to equality,

And this implies that has only two divisors and so must be prime and . Therefore is a prime number, which completes the proof. QED.

So the problem of finding even perfect numbers boils down to the hunt for Mersenne primes. And I remember the last time I wrote the article on the largest known prime, the last greatest Mersenne prime was . But now the record has been broken again. On December 7, 2018 the largest known prime (or Mersenne prime) is found to be

which makes the largest known perfect number to be

which is 49,724,095 digits long!

]]>**Proof**

The idea of the proof is to show that the pdf of random variable W is the same as the pdf of chi-square random variable with 1 degree of freedom, . That is

So, our strategy is to find F(w), the cdf of W, and then differentiate it with respect to w to get f(w), the pdf of W.

Here we start,

Now, since standard normal distribution is symmetric about zero. hence,

Now, differentiating F(w) with respect to w to get f(w).

Now, by the Fundamental Theorem of Calculus and chain rule, we get

Now since , we get

]]>After this Jesus revealed himself again to the disciples by the Sea of Tiberias, and he revealed himself in this way. Simon Peter, Thomas (called the Twin), Nathanael of Cana in Galilee, the sons of Zebedee, and two others of his disciples were together. Simon Peter said to them, “I am going fishing.” They said to him, “We will go with you.” They went out and got into the boat, but that night they caught nothing.

Just as day was breaking, Jesus stood on the shore; yet the disciples did not know that it was Jesus. Jesus said to them, “Children, do you have any fish?” They answered him, “No.” He said to them, “Cast the net on the right side of the boat, and you will find some.” So they cast it, and now they were not able to haul it in, because of the quantity of fish. That disciple whom Jesus loved therefore said to Peter, “It is the Lord!” When Simon Peter heard that it was the Lord, he put on his outer garment, for he was stripped for work, and threw himself into the sea. The other disciples came in the boat, dragging the net full of fish, for they were not far from the land, but about a hundred yards off.

When they got out on land, they saw a charcoal fire in place, with fish laid out on it, and bread. Jesus said to them, “Bring some of the fish that you have just caught.” So Simon Peter went aboard and hauled the net ashore, full of large fish, 153 of them. And although there were so many, the net was not torn.

Why the number 153 is mentioned specifically in the gospel? There is no clear answer to this question. 153 may looks like a random number that doesn’t have any meaning in the story. So, let’s try to examine the number 153.

153 is obviously divisible by 9 because 1 + 5 + 3 = 9. So let’s divide that by 9 and we’ll get 17. Hence,

Now, since two times 9 is 18 and this implies that 153 is the 17th triangular number.

What so special about the 17th triangular number? 17 is a prime number. 17 is 10 plus 7. There is a 10 commandments and God creates the earth in 7 days. Could this be the hidden message? Or maybe this

Anyhow, I don’t know neither. But mathematically, the number 153 indeed has some nice properties. Such as:

- 153 is a 17th triangular number.
- 153 is equal to the sum of the first 5 factorials.
- 153 is an Armstrong number.

An Armstrong number is a positive integer that is equal to the sum of its digits each raised to the power of the number of digits.

]]>I have never written anything on Statistics (coz I hate statistics) on my blog so far and I believe I am going to start writing something on it from now on. I picked Normal Distribution because it is important. By Central limit theorem, in simple terms if you have many independent random variables that are generated by all kinds of crazy distribution, the sum of those random variables will tends toward the Normal distribution.

**Normal Distribution**

where .

Then the MGF (Moment Generating Function) would be the following:

Now using completing the square,

hence,

Since the integral is the cumulative distribution function of the normal distribution which shift to the right by units, the integral does sum to one. Therefore we left with

**Expected Value**

**Variance**

Hence,

]]>**2 is the only even prime number**

Any even number that is greater than 2 can be written as the product of 2 and a natural number greater than one so all even numbers greater than 2 are composite.

**91 is NOT a prime number**

I think almost all students in elementary school or even some in highschool thought 91 is a prime number. I am not kidding, if you are a teacher or a math tutor, you know what I mean. Almost 9 out of 10 students I encountered with always think 91 is a prime number. It could be that 91 isn’t in the times table? and it is odd and doesn’t end with a 5? and maybe it is obviously not divisible by 3 that makes people think 91 is highly unlikely a composite number? Or maybe people are too lazy to try to divide 91 by 7 and see for themselves.

**1979 is the year I was born and it is a prime number**

Yeah I am kind of proud to be born on the year that is a prime

**2017 is the year which bitcoin increased 20 fold**

It’s not because of bitcoin price has been increased from $1000 to $20,000 in the year 2017. The reason I think 2017 is an interesting prime number is that if you add up all the odd prime numbers from 3 all the way up to 2017, you will get a prime number as the result. 3 + 5 + 7 + 11 + 13 + … + 2017 = 283079 which is a prime number. You can check it with wolfram alpha. There are also some fun facts about 2017 I found on the internet.

- 20170123456789 is prime
- 2017π (round to nearest integer) = 6337 is prime
- 2017e (round to nearest integer) = 5483 is prime
- The sum of the cube of gap of primes up to 2017 is a prime number.

- These three prime numbers are consecutive

**prime numbers that you can find in Pi**

This is first 50 digits of Pi.

Couple years ago I was reading a book on recreational math and the author quoted that the first 12 digits of Pi (after rounding off) is a prime number. 314159265359 is a prime number. Of course you can always check it with wolfram alpha. So I found 3, 31, 314159, and 31415926535897932384626433832795028841 are also primes as well. There maybe more. I may wrote a script on maple to find more later when I have the time.

**a prime that is unlucky with the devil**

1000000000000066600000000000001 is a prime number. 666 is the number of a beast in the bible (I didn’t read the whole bible, that’s just what everyone is saying). The number 666 is considered as a devil which sits right inside in the middle of this prime number. And there are “13” zeros on the left and on the right of the number 666. Why 13 is unlucky? I don’t have a clue just go along with the majority.

**12345678910987654321 is a prime number**

This is no doubt one of the nice prime numbers even a 3 year old can remember.

**a prime number that ends with “19” and “67”**

1234567891011121314151617181967 is a prime number. This is a prime number that is easy to remember if you are a HKer and speak Cantonese because it is “19” and “67”. This number is very nice all you need to do is to write down the number 1, 2, 3, all the way up to 19 and then ends it with 67.

**the largest known prime as of March 2018**

I can’t end this article without writing down the largest known prime to human. As of March 2018 according to Wikipedia, the largest known prime is

which is found by the GIMPS (Greatest Internet Mersenne Prime Search) in 2017. I am not gonna bother typing the number out because it is 23,249,425 digits long!

]]>