# generació individual dels elements
def padovan_1():
    x0 = 1
    x1 = 0
    x2 = 0
    while True:
        yield(x0, x1, x2)
        x3 = x1 + x0
        x0 = x1
        x1 = x2
        x2 = x3

# usant tuples per grups de 3 nombres consecutius
def padovan_2():
    tp = (1, 0, 0)
    while True:
        yield tp
        nou = tp[1] + tp[0]
        tp = tp[1:] + (nou,)

padovan = padovan_1
#padovan = padovan_2
