Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
hughbert_cumberdale
Posts: 9
Joined: Thu Apr 09, 2026 7:54 am

Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

Post by hughbert_cumberdale »

I'm working on the bonus problem about negatively continued fractions, does the set of coefficients have to repeat immediately or can there be a non-repeating section first?
User avatar
neverforget
Posts: 88
Joined: Sat Sep 16, 2006 10:10 pm

Re: Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

Post by neverforget »

Periodic negatively continued fractions have no non-repeating section.
Image
hughbert_cumberdale
Posts: 9
Joined: Thu Apr 09, 2026 7:54 am

Re: Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

Post by hughbert_cumberdale »

Great thanks. This is a hard question, there seems to be very little written about negatively continued fractions so it's hard to learn the number theory for it. My code gives the wrong answer and only takes 13 hours :lol:
hughbert_cumberdale
Posts: 9
Joined: Thu Apr 09, 2026 7:54 am

Re: Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

Post by hughbert_cumberdale »

Another question, it's not clear to me if repeated sequences are valid, for example if 1,2 is a complex sequence, and 1,2,1,2 is also complex, then do we count both? Because by my calculations, 1,1 is a complex sequence but in the example it says that the only complex sequences that are 2 elements long are 1,2 2,1 1,3 and 3,1.
pjt33
Posts: 137
Joined: Mon Oct 06, 2008 6:14 pm

Re: Bonus problem 0 - 1/ (0 - 1 (0 .... (called #contfrac in browser tab)

Post by pjt33 »

hughbert_cumberdale wrote: Mon Jun 01, 2026 11:50 pm Another question, it's not clear to me if repeated sequences are valid, for example if 1,2 is a complex sequence, and 1,2,1,2 is also complex, then do we count both?
They are infinite periodic sequences, so $\overline{1, 2}$ and $\overline{1, 2, 1, 2}$ are the same sequence and should only be counted once.
Post Reply