### Re: problem 065

Posted:

**Sat Mar 22, 2014 9:23 am**A library is a set of routines to handle specific tasks, often in a separate file.

bigints are big integers (numbers).

bigints are big integers (numbers).

A website dedicated to the puzzling world of mathematics and programming

https://projecteuler.chat/

Page **2** of **2**

Posted: **Sat Mar 22, 2014 9:23 am**

A library is a set of routines to handle specific tasks, often in a separate file.

bigints are big integers (numbers).

bigints are big integers (numbers).

Posted: **Sat Mar 22, 2014 9:26 am**

Thanks again!

EDIT (18 april 2014):

As I've said before, Python is indeed a nice language, with many benefits. Except for it's capability with huge numbers, string handling is the best. For example, concatenating two numbers, a=12345,b=67890: int(str(a)+str(b)) #returns 1234567890. That's easier than something like a*(10^(digits(b)))+b in C.

EDIT (18 april 2014):

As I've said before, Python is indeed a nice language, with many benefits. Except for it's capability with huge numbers, string handling is the best. For example, concatenating two numbers, a=12345,b=67890: int(str(a)+str(b)) #returns 1234567890. That's easier than something like a*(10^(digits(b)))+b in C.

Posted: **Tue Aug 11, 2015 5:43 pm**

Although, if you step up to c++ handling integers as strings is simplified greatly by using stringstreams.

concatenating long ints a = 12345 and b = 67890 is as simple as

ss << a << b;

which can be >> out to an unsigned long long int, string, or any container you choose to provide functionality with the >> operator.

concatenating long ints a = 12345 and b = 67890 is as simple as

ss << a << b;

which can be >> out to an unsigned long long int, string, or any container you choose to provide functionality with the >> operator.

Posted: **Fri Jan 31, 2020 9:02 am**

In the problem statement it lists 2k as one of the components of the continued fraction, but nowhere is it stated what k is. Help?

Posted: **Fri Jan 31, 2020 9:31 am**

It is just there to indicate that the pattern shown in the first numbers continues. It shows what an arbitrary section of the list would look like. Here are some other examples of this notation:Junglemath wrote: ↑Fri Jan 31, 2020 9:02 am In the problem statement it lists 2k as one of the components of the continued fraction, but nowhere is it stated what k is. Help?

{1,3,5,7,...,2k+1,...}

{1,2,4,8,...,2^k,...}

{1,10,1,20,1,30,1,40,...,1,10k,...}

Posted: **Fri Jan 31, 2020 9:51 am**

So is the pattern that they are trying to conveyjaap wrote: ↑Fri Jan 31, 2020 9:31 amIt is just there to indicate that the pattern shown in the first numbers continues. It shows what an arbitrary section of the list would look like. Here are some other examples of this notation:Junglemath wrote: ↑Fri Jan 31, 2020 9:02 am In the problem statement it lists 2k as one of the components of the continued fraction, but nowhere is it stated what k is. Help?

{1,3,5,7,...,2k+1,...}

{1,2,4,8,...,2^k,...}

{1,10,1,20,1,30,1,40,...,1,10k,...}

1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, ...

i.e. two 1s followed by the next even integer?

Posted: **Fri Jan 31, 2020 12:44 pm**

Exactly.Junglemath wrote: ↑Fri Jan 31, 2020 9:51 amSo is the pattern that they are trying to conveyjaap wrote: ↑Fri Jan 31, 2020 9:31 amIt is just there to indicate that the pattern shown in the first numbers continues. It shows what an arbitrary section of the list would look like. Here are some other examples of this notation:Junglemath wrote: ↑Fri Jan 31, 2020 9:02 am In the problem statement it lists 2k as one of the components of the continued fraction, but nowhere is it stated what k is. Help?

{1,3,5,7,...,2k+1,...}

{1,2,4,8,...,2^k,...}

{1,10,1,20,1,30,1,40,...,1,10k,...}

1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, ...

i.e. two 1s followed by the next even integer?

BTW, finite continued fractions are always rationals, and infinitely long continued fractions are always irrationals. So it is no surprise that e has an infinite continued fraction.

Periodic continued fractions (i.e. those that eventually repeat) are rational square root expressions, or rather, they are roots of a quadratic polynomial with rational coefficients. So it is again no big surprise that e's continued fraction does not repeat.

But it is surprising that e's continued fraction has a pattern to it at all.

Posted: **Fri Jan 31, 2020 8:43 pm**

Nice. Thanks.jaap wrote: ↑Fri Jan 31, 2020 12:44 pmExactly.Junglemath wrote: ↑Fri Jan 31, 2020 9:51 amSo is the pattern that they are trying to conveyjaap wrote: ↑Fri Jan 31, 2020 9:31 am

It is just there to indicate that the pattern shown in the first numbers continues. It shows what an arbitrary section of the list would look like. Here are some other examples of this notation:

{1,3,5,7,...,2k+1,...}

{1,2,4,8,...,2^k,...}

{1,10,1,20,1,30,1,40,...,1,10k,...}

1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, ...

i.e. two 1s followed by the next even integer?

BTW, finite continued fractions are always rationals, and infinitely long continued fractions are always irrationals. So it is no surprise that e has an infinite continued fraction.

Periodic continued fractions (i.e. those that eventually repeat) are rational square root expressions, or rather, they are roots of a quadratic polynomial with rational coefficients. So it is again no big surprise that e's continued fraction does not repeat.

But it is surprising that e's continued fraction has a pattern to it at all.

Posted: **Sun Feb 02, 2020 11:18 pm**

Posted: **Mon Feb 03, 2020 6:49 am**

I'm saying that you would not expect a pattern for e, so it is surprising that there is one.

Posted: **Mon Feb 03, 2020 1:59 pm**

Another thing: is the 100th fraction supposed to be reduced to lowest terms before summing the numerator? I feel that this should be specified in the problem statement.

Posted: **Mon Feb 03, 2020 2:14 pm**

Here's some reading stuff:

https://math.stackexchange.com/question ... raction-al

https://math.stackexchange.com/question ... raction-al

Posted: **Mon Feb 03, 2020 2:18 pm**

Thanks, although isn't this considered a slight spoiler?hk wrote: ↑Mon Feb 03, 2020 2:14 pm Here's some reading stuff:

https://math.stackexchange.com/question ... raction-al

Posted: **Mon Feb 03, 2020 3:14 pm**

I don't think so. These problems about continued fractions are meant to invite you to look up the concept.

E.g. from wikipedia. If you do so you will learn the things on the page I gave you fast enough .

E.g. from wikipedia. If you do so you will learn the things on the page I gave you fast enough .