ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1407. One-two, One-two

Is there a recurrence formula?
Posted by Grigor Gevorgian 17 Sep 2008 19:13
I know that f(n) can be formed by adding 1 or 2 in front of f(n-1),but I dont see any order in addings.If you know,please tell me.
Re: Is there a recurrence formula?
Posted by Denis Koshman 17 Sep 2008 20:55
AFAIK, I solved it looking at base-2 representation of 122221212121...(base-10). With each step you multiply it by 10 and add 1 or 2 (next decimal digit from left to right). You want the result to become 10000000000000...000 (base-2).