Project Euler #151: Paper sheets of standard sizes: an expected-value problem.

  • + 1 comment

    This is what I have got for N=4, but still not correct according to the checker. I hope my mistake can be pointed out since I got the same answer by hand.

    0 0 0 0: 0

    0 0 0 1: 1

    0 0 0 2: 1

    0 0 0 3: 1

    0 0 0 4: 1

    0 0 1 0: 2

    0 0 1 1: 500000005 (3/2)

    0 0 1 2: 333333337 (4/3)

    0 0 1 3: 250000003 (5/4)

    0 0 2 0: 500000006 (5/2)

    0 0 2 1: 888888897 (17/9)

    0 0 2 2: 625000006 (13/8)

    0 1 0 0: 500000006 (5/2)

    0 1 0 1: 666666673 (5/3)

    0 1 0 2: 416666671 (17/12)

    0 1 1 0: 777777786 (25/9)

    0 1 1 1: 13888891 (145/72)

    1 0 0 0: 13888892 (217/72)