%I #16 Nov 01 2019 18:37:08
%S 1,1,-1,0,1,-1,-1,1,1,0,-1,-1,1,0,-1,1,1,0,-1,0,1,-1,-1,0,1,1,-1,-1,1,
%T 0,-1,1,1,0,-1,0,1,-1,-1,1,1,0,-1,-1,1,0,-1,0,1,1,-1,0,1,-1,-1,0,1,1,
%U -1,-1,1,0,-1,1,1,0,-1,0,1,-1,-1,1,1,0,-1,-1,1,0,-1,1,1,0,-1,0,1,-1,-1,0,1,1,-1,-1,1,0,-1,0,1,1,-1,0,1
%N G.f. satisfies (1+x^2)*g(x) = 1 + x*g(x^2).
%C From _Peter Bala_, Jan 05 2015: (Start)
%C The set of all terms is {-1,0,1}.
%C Proof. It is not difficult to verify that the function g(x) defined by g(x) = (1 - x^2)*( 1/(1 - x^4) + x/(1 - x^8) + x^3/(1 - x^16) + x^7/(1 - x^32) + ...), for |x| < 1, satisfies the functional equation (1 + x^2)*g(x) = 1 + x*g(x^2).
%C We thus have g(x) = (1 - x^2)*S(x), where S(x) = sum {n>=0} ( x^(4*n) + x^(8*n + 1) + x^(16*n + 3) + x^(32*n + 7) + ...). It is easy to see that the arithmetic progressions {4*n}, {8*n + 1}, {16*n + 3}, {32*n + 7}, ... are disjoint and hence S(x) has coefficients in {0,1}. It follows that g(x) = (1 - x^2)*S(x) has coefficients in {-1,0,1}. (End)
%H Robert Israel, <a href="/A253414/b253414.txt">Table of n, a(n) for n = 0..10000</a>
%F a(2*k) = (-1)^k.
%F a(1) = 1.
%F a(2*k+1)=a(k)-a(2*k-1) for k >= 1.
%F G.f.: g(x) = 1/(1 + x^2) + x/((1 + x^2)*(1 + x^4)) + x^3/((1 + x^2)*(1 + x^4)*(1 + x^8)) + ... = (1 - x^2)*( 1/(1 - x^4) + x/(1 - x^8) + x^3/(1 - x^16) + ... ). - _Peter Bala_, Jan 05 2015
%e (1+x^2)*(1 + x - x^2 + x^4 + ...) = 1 + x*(1 + x^2 - x^4 + ...)
%p N:= 100: # to get a(0) to a(N)
%p A:= Array(0..N):
%p for i from 0 to floor(N/2) do
%p A[2*i] := (-1)^i
%p od:
%p A[1]:= 1:
%p for i from 1 to floor((N-1)/2) do
%p A[2*i+1]:= A[i] - A[2*i-1]
%p od:
%p seq(A[i],i=0..N);
%t nmax = 100; sol = {a[0] -> 1};
%t Do[A[x_] = Sum[a[k] x^k, {k, 0, n}] /. sol; eq = CoefficientList[(1 + x^2) A[x] - (1 + x A[x^2]) + O[x]^(n + 1), x] == 0 /. sol; sol = sol ~Join~ Solve[eq][[1]], {n, 1, nmax}];
%t sol /. Rule -> Set;
%t a /@ Range[0, nmax] (* _Jean-François Alcover_, Nov 01 2019 *)
%K sign
%O 0
%A _Robert Israel_, Dec 31 2014