Ruby, 26 bytes
anonymous function with iteration.
->n{a=1;n.times{a^=a*2};a}
this recursive function is one byte shorter, but as it needs to be named to be able to refer to itself, it ends up one byte longer.
f=->n{n<1?1:(s=f[n-1])^s*2}
anonymous function with iteration.
->n{a=1;n.times{a^=a*2};a}
this recursive function is one byte shorter, but as it needs to be named to be able to refer to itself, it ends up one byte longer.
f=->n{n<1?1:(s=f[n-1])^s*2}