A014577(n)=1/2*(1+(-1)^(1/2*((n+1)/2^valuation(n+1, 2)-1)))

{
	k=-1;
	z=0; d=1;
	for (n=0, 2^24,
		if (real(z)==0,
			print (k++ " " imag(z));
		);
		z += d;
		d*=if (A014577(n), +I, -I)
	)
}

quit