1.8 KiB
1.8 KiB
id | challengeType | title |
---|---|---|
5900f5451000cf542c510057 | 5 | Problem 472: Comfortable Distance II |
Description
Here are the possible seating arrangements for N = 15:
We see that if the first person chooses correctly, the 15 seats can seat up to 7 people. We can also see that the first person has 9 choices to maximize the number of people that may be seated.
Let f(N) be the number of choices the first person has to maximize the number of occupants for N seats in a row. Thus, f(1) = 1, f(15) = 9, f(20) = 6, and f(500) = 16.
Also, ∑f(N) = 83 for 1 ≤ N ≤ 20 and ∑f(N) = 13343 for 1 ≤ N ≤ 500.
Find ∑f(N) for 1 ≤ N ≤ 1012. Give the last 8 digits of your answer.
Instructions
Tests
tests:
- text: <code>euler472()</code> should return 73811586.
testString: assert.strictEqual(euler472(), 73811586, '<code>euler472()</code> should return 73811586.');
Challenge Seed
function euler472() {
// Good luck!
return true;
}
euler472();
Solution
// solution required