f(0) does not print anything.
f(1) prints 1 and 1.
f(n) prints n, f(n-2), again n and then f(n-3).
So, we can have the recurrence relation for the sum of values being printed as
$P(n) = 2n + P(n-2) + P(n-3), P(n\leq0) = 0.$
$P(1) = 2, P(2) = 4, P(3) = 8, P(4) = 14$
$P(6) = 2\times 6 + P(4) + P(3) \\=12 + 14 + 8 = 34.$