Microsoft Interview Question

find the nth element of a sequence.