Irrational numbers like \(\sqrt 2 \) does not exhibit any pattern in its decimal number. \(\sqrt 2 \) = 1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309...

Sum of the house numbers upto \(x-1\) = Sum of the house numbers after \(x\) to \(n\)

Sum of the house numbers upto \(x-1\) = Sum of all the house numbers - Sum of the house numbers till \(x\)

\(\dfrac{{\left( {x - 1} \right)x}}{2} = \dfrac{{n\left( {n + 1} \right)}}{2} - \dfrac{{x\left( {x + 1} \right)}}{2}\)

Simplifying this,

\( \Rightarrow \) \(\dfrac{{\left( {x - 1} \right)x}}{2} + \dfrac{{x\left( {x + 1} \right)}}{2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

\( \Rightarrow \) \(\dfrac{{{x^2}}}{2} - \dfrac{x}{2} + \dfrac{{{x^2}}}{2} + \dfrac{x}{2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

\( \Rightarrow \) \({x^2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

Multiplying both sides by 8,

\(8{x^2} = 4{n^2} + 4n\)

Adding 1 on both sides

\(1 + 8{x^2} = 4{n^2} + 4n + 1\)

\(1 + 2{\left( {2x} \right)^2} = {\left( {2n + 1} \right)^2}\)

Let \(2n + 1 = k\), \(2x = m\)

\(1 + 2{m^2} = {k^2}\)

(or) \({k^2} - 2{m^2} = 1\)

( \( \because \) The above equation is called Pell's equation. We will discuss the above equation in detail in the subsequent lessons )

We have got an indeterminate equation of second order. The most interesting part is, the solutions of the above equation are convergents of \(\sqrt 2 \).

But we have to choose a convergent, who numerator is odd and denominator is even.

The convergent which satisfies the condition is \(\dfrac{{577}}{{408}}\)

Here \(2n + 1 = 577\),

\( \Rightarrow n = 288\)

So total houses are \( 288 \)

Also house number = \(2k = 408\)

\( \Rightarrow k = 204\)

So House number is \(204 \).

Square of a number = Sum of few natural numbers.

The numbers which satisfy the above condition are called

1, 36, 1225, 41616, ... are a few numbers which satisfy the condition.

For example, 36 = \(36 = {6^2} = \dfrac{{8\left( {8 + 1} \right)}}{2}\)

So If total houses are below \(10\), then total houses are \(8 \), and house numbers is \(6 \).

As total houses are above 50 and below 500, we have to take \(41616 \)

\(41616 = {204^2} = \dfrac{{288\left( {288 + 1} \right)}}{2}\)

Therefore, total houses are \(288 \), House number is \(204 \)

How to generate square triangular numbers?

There is an amazing generating function whose coefficients will give you the answer!!

\(\dfrac{{1 + x}}{{\left( {1 - x} \right)\left( {{x^2} - 34x + 1} \right)}}\) = \(1\) + \(36x\) + \(1225{x^2}\) + \(41616{x^3} + ...\)

Have you observed any pattern in the above expression? No.

But Irrational numbers especially of the format \(\sqrt n \) exhibit some beautiful pattern when we write them in "continued fraction" format.

\( \sqrt 2 = 1 + \sqrt 2 - 1 \)

\( = 1 + \left( {\sqrt 2 - 1} \right) \times \dfrac{{\sqrt 2 + 1}}{{\sqrt 2 + 1}} \)

\( = 1 + \left( {\sqrt 2 - 1} \right) \times \dfrac{{\sqrt 2 + 1}}{{\sqrt 2 + 1}} \)

\( = 1 + \dfrac{1}{{\sqrt 2 + 1}}\)

\( = 1 + \dfrac{1}{{1 + \sqrt 2 }} \)

\( = 1 + \dfrac{1}{{1 + \sqrt 2 }} \)

Replacing the value of \(\sqrt 2 \) in the last step by \(1 + \dfrac{1}{{1 + \sqrt 2 }}\) we get,

= \(1 + \dfrac{1}{{1 + \left( {1 + \dfrac{1}{{1 + \sqrt 2 }}} \right)}}\)

= \(1 + \dfrac{1}{{2 + \dfrac{1}{{1 + \sqrt 2 }}}}\)

Again replacing the value of \(\sqrt 2 \) by \(1 + \dfrac{1}{{1 + \sqrt 2 }}\) we get,

= \( 1 + \dfrac{1}{{2 + \cfrac{1}{{1 + \left( {1 + \cfrac{1}{{1 + \sqrt 2 }}} \right)}}}}\)

= \(1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{1 + \sqrt 2 }}}}}}\)

Continuing this pattern results in,

\(\sqrt 2 = 1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{2 + ..}}}}}}}}\)

= \(1 + \dfrac{1}{{1 + \left( {1 + \dfrac{1}{{1 + \sqrt 2 }}} \right)}}\)

= \(1 + \dfrac{1}{{2 + \dfrac{1}{{1 + \sqrt 2 }}}}\)

Again replacing the value of \(\sqrt 2 \) by \(1 + \dfrac{1}{{1 + \sqrt 2 }}\) we get,

= \( 1 + \dfrac{1}{{2 + \cfrac{1}{{1 + \left( {1 + \cfrac{1}{{1 + \sqrt 2 }}} \right)}}}}\)

= \(1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{1 + \sqrt 2 }}}}}}\)

Continuing this pattern results in,

\(\sqrt 2 = 1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{{2 + ..}}}}}}}}\)

You can see the the beautiful pattern of \(\sqrt 2 \) here.

The above pattern can be expressed compactly, \(\sqrt 2 = 1 + \dfrac{1}{{2 + }}~\dfrac{1}{{2 + }}~\dfrac{1}{{2 + }}....\)

(or) \(\sqrt 2 = \left[ {1;~2,~2,~2, . . .} \right]\)

The convergents of \(\sqrt 2 \) = \(1\), \(\dfrac{3}{2}\), \(\dfrac{7}{5}\), \(\dfrac{{17}}{{12}}\), \(\dfrac{{41}}{{29}}\), \(\dfrac{{99}}{{70}}\), \(\dfrac{{239}}{{169}}\), \(\dfrac{{577}}{{408}}\), . . .

It is easy to find the convergents of \(\sqrt 2 \).

First convergent = \(1\)

Second convergent = \(1 + \dfrac{1}{2} = \dfrac{3}{2}\)

Third convergent = \(1 + \cfrac{1}{{2 + \cfrac{1}{2}}} = \cfrac{7}{5}\)

Fourth convergent = \(1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{2}}}}}\) = \(\dfrac{{17}}{{12}}\)

If one convergent of \(\sqrt 2 \) is \(\dfrac{p}{q}\), then next convergent = \(\dfrac{{p + 2q}}{{p + q}}\)

Slightly shortened, the problem was as follows.

A friend of mine lived in a long street with houses numbered one, two, three, and so on. The numbers of the houses below him added up to exactly the same as the numbers above him. There were between fifty and five hundred houses in the street. What was the number of my friend's house?

Ramanujan might have solved this question by the following method:

We know that sum of the first \(n\) natural numbers sum = \(\dfrac{{n\left( {n + 1} \right)}}{2}\)The above pattern can be expressed compactly, \(\sqrt 2 = 1 + \dfrac{1}{{2 + }}~\dfrac{1}{{2 + }}~\dfrac{1}{{2 + }}....\)

(or) \(\sqrt 2 = \left[ {1;~2,~2,~2, . . .} \right]\)

The convergents of \(\sqrt 2 \) = \(1\), \(\dfrac{3}{2}\), \(\dfrac{7}{5}\), \(\dfrac{{17}}{{12}}\), \(\dfrac{{41}}{{29}}\), \(\dfrac{{99}}{{70}}\), \(\dfrac{{239}}{{169}}\), \(\dfrac{{577}}{{408}}\), . . .

It is easy to find the convergents of \(\sqrt 2 \).

First convergent = \(1\)

Second convergent = \(1 + \dfrac{1}{2} = \dfrac{3}{2}\)

Third convergent = \(1 + \cfrac{1}{{2 + \cfrac{1}{2}}} = \cfrac{7}{5}\)

Fourth convergent = \(1 + \cfrac{1}{{2 + \cfrac{1}{{2 + \cfrac{1}{2}}}}}\) = \(\dfrac{{17}}{{12}}\)

If one convergent of \(\sqrt 2 \) is \(\dfrac{p}{q}\), then next convergent = \(\dfrac{{p + 2q}}{{p + q}}\)

### Applications of continued fractions of irrational numbers:

While Ramanujan was at Cambridge, a friend posed a problem to him which was taken from the "Strand magazine". Ramanujan answered immediately, giving a continued fraction, whose convergents were the general solution to the problem. His friend was astounded. How, he asked Ramanujan, had he done it? He replied: "Immediately I heard the problem, it was obvious that the answer was a continued fraction; I then thought, 'Which continued fraction?', and the answer came to my mind!"Slightly shortened, the problem was as follows.

**Question:**A friend of mine lived in a long street with houses numbered one, two, three, and so on. The numbers of the houses below him added up to exactly the same as the numbers above him. There were between fifty and five hundred houses in the street. What was the number of my friend's house?

**Solution:**Ramanujan might have solved this question by the following method:

Sum of the house numbers upto \(x-1\) = Sum of the house numbers after \(x\) to \(n\)

Sum of the house numbers upto \(x-1\) = Sum of all the house numbers - Sum of the house numbers till \(x\)

\(\dfrac{{\left( {x - 1} \right)x}}{2} = \dfrac{{n\left( {n + 1} \right)}}{2} - \dfrac{{x\left( {x + 1} \right)}}{2}\)

Simplifying this,

\( \Rightarrow \) \(\dfrac{{\left( {x - 1} \right)x}}{2} + \dfrac{{x\left( {x + 1} \right)}}{2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

\( \Rightarrow \) \(\dfrac{{{x^2}}}{2} - \dfrac{x}{2} + \dfrac{{{x^2}}}{2} + \dfrac{x}{2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

\( \Rightarrow \) \({x^2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)

Multiplying both sides by 8,

\(8{x^2} = 4{n^2} + 4n\)

Adding 1 on both sides

\(1 + 8{x^2} = 4{n^2} + 4n + 1\)

\(1 + 2{\left( {2x} \right)^2} = {\left( {2n + 1} \right)^2}\)

Let \(2n + 1 = k\), \(2x = m\)

\(1 + 2{m^2} = {k^2}\)

(or) \({k^2} - 2{m^2} = 1\)

( \( \because \) The above equation is called Pell's equation. We will discuss the above equation in detail in the subsequent lessons )

We have got an indeterminate equation of second order. The most interesting part is, the solutions of the above equation are convergents of \(\sqrt 2 \).

But we have to choose a convergent, who numerator is odd and denominator is even.

The convergent which satisfies the condition is \(\dfrac{{577}}{{408}}\)

Here \(2n + 1 = 577\),

\( \Rightarrow n = 288\)

So total houses are \( 288 \)

Also house number = \(2k = 408\)

\( \Rightarrow k = 204\)

So House number is \(204 \).

### Square triangular numbers:

After simplifying we reached this point in the above discussion. \({x^2} = \dfrac{{n\left( {n + 1} \right)}}{2}\)Square of a number = Sum of few natural numbers.

The numbers which satisfy the above condition are called

*square triangular numbers.*1, 36, 1225, 41616, ... are a few numbers which satisfy the condition.

For example, 36 = \(36 = {6^2} = \dfrac{{8\left( {8 + 1} \right)}}{2}\)

So If total houses are below \(10\), then total houses are \(8 \), and house numbers is \(6 \).

As total houses are above 50 and below 500, we have to take \(41616 \)

\(41616 = {204^2} = \dfrac{{288\left( {288 + 1} \right)}}{2}\)

Therefore, total houses are \(288 \), House number is \(204 \)

How to generate square triangular numbers?

There is an amazing generating function whose coefficients will give you the answer!!

\(\dfrac{{1 + x}}{{\left( {1 - x} \right)\left( {{x^2} - 34x + 1} \right)}}\) = \(1\) + \(36x\) + \(1225{x^2}\) + \(41616{x^3} + ...\)