Ad
  • Default User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Python translation, please review.

  • Custom User Avatar

    JS tests. In the fixed tests, this block:

      describe("large terms",()=>{
        it("exp",()=>{
          assert.approximately( take(51)(exp())[50], 1/30414093201713378043612608166064768844377641568960512000000000000, 1e-72 );
        });
        it("sin",()=>{
          assert.approximately( take(52)(exp())[51], 1/1551118753287382280224243016469303211063259720016986112000000000000, 1e-74 );
        });
        it("cos",()=>{
          assert.approximately( take(53)(exp())[52], 1/80658175170943878571660636856403766975289505440883277824000000000000, 1e-75 );
       ` });
    

    should be replaced by:

      describe("large terms",()=>{
        it("exp",()=>{
          assert.approximately( take(51)(exp())[50], 1/30414093201713378043612608166064768844377641568960512000000000000, 1e-72 );
        });
        it("sin",()=>{
          assert.approximately( take(52)(sin())[51], -1/1551118753287382280224243016469303211063259720016986112000000000000, 1e-74 );
        });
        it("cos",()=>{
          assert.approximately( take(53)(cos())[52], 1/80658175170943878571660636856403766975289505440883277824000000000000, 1e-75 );
       ` });
    

    (Testing sin and cos, and changing the value for sin.)

  • Default User Avatar

    My implementation returns the 1.000.000th element of the sequence in about 400ms. Why do the tests time out?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Sorry, I beat you to it. (Duplicate)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Very nice one!
    It seems that the value of n can be easily cranked up to 5 * 10^6...

  • Custom User Avatar

    module name is mispelt, everywhere.

  • Custom User Avatar

    I suggest you add a link to "Tiling a rectangle with squares" for users that want an additional challenge.

  • Custom User Avatar

    If the tests are failing or timing out for you, then try to choose the values of c and d optimally

    Or recommend that sorting values be achieved in O(n), letting laziness work for you, and taking advantage of the fact you can generate presorted values, instead of dumping a limited ( but higher than necessary ) number of sorted values into one big bucket and having to then sort them from scratch in O(n log n).

  • Custom User Avatar

    S(θ) = the set of numbers c + dθ, where c and d are positive integers

    How can that list for θ = 1.618, sorted, contain only integers? Where did 2.618 in the list go?

    cn(θ) + θdn(θ)

    OK, so cn(θ) = S(θ) - θdn(θ). But what is θdn(θ) ? Is it map (* θ) dn(θ) somehow? Is dn(θ) equal to map (* d) n(θ) ? What is n(θ) ? Is dn a lexeme, is θdn a lexeme?

    Why is "irrational" in quotes? Why does θ have two asterisks? Is there a missing footnote somewhere?

  • Custom User Avatar

    Please specify in bold, blinking all-caps that your sequence is indexed 1-based.

    Or just use 0-based indexing. Why waste a perfectly good number ( and go against established convention ) ?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...