Hofstadter sequences are a family of related integer sequences, among which the first ones were described by an American professor Douglas Hofstadter in his book Gödel, Escher, Bach. 
### Task
Today we will be implementing the rather chaotic recursive sequence of integers called Hofstadter Q.
The Hofstadter Q is defined as:
As the author states in the aforementioned book:It is reminiscent of the Fibonacci definition in that each new value is a sum of two
previous values-but not of the immediately previous two values. Instead, the two
immediately previous values tell how far to count back to obtain the numbers to be added
to make the new value.
The function produces the starting sequence:  
`1, 1, 2, 3, 3, 4, 5, 5, 6 . . .`  
Test info: 100 random tests, n is always positive
Good luck!
import sys; sys.setrecursionlimit(10000)
from functools import lru_cache

@lru_cache(maxsize=None)
def Q(n):
    if n <= 2:
        return 1
    return Q(n - Q(n-1)) + Q(n - Q(n-2))
    
def hofstadter_Q(n):
    return Q(n)
import sys; sys.setrecursionlimit(10000)
from functools import lru_cache

@lru_cache(maxsize=None)
def Q(n):
    if n <= 2:
        return 1
    return Q(n - Q(n-1)) + Q(n - Q(n-2))
    
def hofstadter_Q(n):
    return Q(n)