     L. Van Warren / wxMaxima / 2015 / OEIS

kill(all)$

z(a,b):=a+b*%i;

f(k):=(%i+1)^(k);

isPureReal(w):=is(equal(imagpart(w),0));

isPureImag(w):=is(equal(realpart(w),0));

isBoth(w):=is(notequal(realpart(w),0)) and is(notequal(imagpart(w),0));

["pure real entries for k", delete(false,makelist( if isPureReal(f(k)) then k,k,0,40))];

     Candidate OEIS: Online Encylopedia of Integer Sequences http://oeis.org
     This generates powers of four with alternating signs.

["pure real values are f(k)", delete(false,makelist( if isPureReal(f(k)) then realpart(f(k)),k,0,40))];

["pure real entries for k", delete(false,makelist( if isPureImag(ratsimp(f(k))) then k,k,0,40))];

["mixed  entries for k", delete(false,makelist( if isBoth(ratsimp(f(k))) then k,k,0,40))];