ROSECODE 531
Every day is a holiday revisited
On planet J, a year lasts for days. Holidays are defined by the two following rules.
1. At the beginning of the reign of the current Emperor, his birthday is declared a holiday from that year onwards.
2. If both the day before and after a day are holidays, then also becomes a holiday.
Initially there are no holidays. Let be the number of methods such that all the days of the year are holidays after exactly days, with the year lasts for days.
You are given , , .
Find .
Thanks to baihacker for the idea.
This problem was inspired by Problem 645 at Project Euler (https://projecteuler.net/problem=645)
1. At the beginning of the reign of the current Emperor, his birthday is declared a holiday from that year onwards.
2. If both the day before and after a day
Initially there are no holidays. Let
You are given
Find
Thanks to baihacker for the idea.
This problem was inspired by Problem 645 at Project Euler (https://projecteuler.net/problem=645)