Can you write me a function in Python, which calculates any nth element of the aforementioned sequence?