5 kyu

Convergents of e

34 of 99HDdo
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • tobeannouncd Avatar
  • Invariance Avatar

    Python is currently failing with what appears to be an error in the reference solution (see spoiler comment below).

  • Just4FunCoder Avatar

    This comment has been hidden.

  • Just4FunCoder Avatar

    This comment has been hidden.

  • Davo36 Avatar

    I assume this can't be solved in Python in time just now right? I find if I just print the convergent number and return 0, that takes over 5 seconds, which is nearly half the time.

    Here's the a short bit of the output of doing that...

    Random tests
    Log
    12431
    0 should equal 71040
    Log
    2399
    0 should equal 11116
    Log
    11245
    0 should equal 63305
    

    I also find that my solution runs in about 6.5 secs on my PC but times out on CodeWars

  • Unnamed Avatar

    Missing pictures in the description. It looks like it should be

    ```math
    \sqrt{2} = 1 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2 + ...}}}}
    ```
    ```math
    1 + \dfrac{1}{2} = \dfrac{3}{2}\\[10pt]
    1 + \dfrac{1}{2 + \dfrac{1}{2}} = \dfrac{7}{5}\\[10pt]
    1 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2}}} = \dfrac{17}{12}\\[10pt]
    1 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2}}}} = \dfrac{41}{29}
    ```
    
  • Jomopipi Avatar

    trickiest 5 kyu yet, mad props!

    suggestion: I would maybe add a picture like this to the description, it's what I kept looking at to do this.

    Mountain View
  • KenKamau Avatar

    Python translation

    Please approve.

  • Cleb3rson Avatar

    could you have something like "Your Mission" to get more clearer?

  • Cleb3rson Avatar

    Good kata, thanks!

  • kgiann78 Avatar

    This comment has been hidden.

  • Blind4Basics Avatar

    Hi,

    I understand nothing to the description... :/

    • please provide the decomposition for sqrt(23) as you did for sqrt(2)
    • e = [2; 1,2,1, 1,4,1, 1,6,1 , … , 1,2k,1, …]. => I finally got that it correspond to the notation used at the top, but it actually doesn't match this notation correctly (where are the parentheses!?). And what is the k thing? You should explain that as well (even if I have my idea about that)
    • What is most surprising is that the important mathematical constant, e = [2; 1,2,1, 1,4,1, 1,6,1 , … , 1,2k,1, …]. => that doesn't mean anything: where is the end of the sentence? what is surprising about that constant??
    • please provide the decomposition (as a picture) explaining sum of digits in the numerator of the 10th convergent is 1+4+5+7=17.
    • finally, if it's "copyright project euler", you should link to it.
  • Jomopipi Avatar

    This comment has been hidden.

  • ZED.CWT Avatar

    Needs Random Tests