We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The case P/Q = 1/2 like the real Project Euler Problem 100 is very easy to solve once you are able to look up the sequence: 1, 3, 15, 85, 493, 2871, 16731,... It turns out to be Sloane's integer sequence https://oeis.org/A011900 which has a nice and easy recurrence of a(n) = 6*a(n-1) - a(n-2) - 2 with a(0) = 1, a(1) = 3.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #100: Arranged probability
You are viewing a single comment's thread. Return to all comments →
The case P/Q = 1/2 like the real Project Euler Problem 100 is very easy to solve once you are able to look up the sequence: 1, 3, 15, 85, 493, 2871, 16731,... It turns out to be Sloane's integer sequence https://oeis.org/A011900 which has a nice and easy recurrence of a(n) = 6*a(n-1) - a(n-2) - 2 with a(0) = 1, a(1) = 3.