I'm interested if you could solve it if you gave it some thought. The interviewer is presumably not expecting you to write it instantly and perfectly, but to reason your way through it over a few minutes.
(I will try it now.)
it can be answered in about 10 lines of C# is an unhelpful way of expressing how difficult a question is.
I remember very well the first time I tried a programming exercise like this. I probably spent 2 minutes writing the loop, and then I must have spent another 20 minutes wondering what I’d done wrong, until I realised that the sequence I’d been given really did converge that slowly. :-)
In the spirit of helping anyone who’s at that stage now, if you’re running on a slow machine, I suggest you try this sequence instead:
(I will try it now.)
it can be answered in about 10 lines of C# is an unhelpful way of expressing how difficult a question is.