%I #39 Jun 02 2022 08:30:43
%S 1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,
%T 0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,
%U 0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0
%N a(1) = 1 and, for all n >= 1, if a(n) = 0 then a(2*n) = 1 and a(2*n+1) = 0 whereas if a(n) = 1 then a(2*n) = 0 and a(2*n+1) = 0.
%C The indices where 1 occurs in {a(n)} are {1, 4, 6, 10, 14, 16, ...} which appear to correspond precisely to the terms of A171945. (That is, if true, then this would be a characteristic function of A171945.) If this were proved then A171945 could be easily extended.
%H Antti Karttunen, <a href="/A217586/b217586.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F Conjecture: a(n) = (1 - (1 - 2*A096268(n-1))*(1 - 2*A036987(n-1)))/2. - _Velin Yanev_, Aug 08 2017
%F From _Michel Dekking_, Apr 19 2019: (Start):
%F Here is a proof of Velin Yanev's conjecture.
%F There is an offset problem. We will give the period-doubling sequence offset 1, and will also consider the characteristic function of powers of 2, A209229, instead of the Fredholm-Rueppel sequence A036987.
%F Let alpha be the period doubling morphism
%F alpha: 0 -> 01, 1 -> 00.
%F Let PD = 01000101... be the fixed point of alpha, with offset 1, so PD(n+1) = A096268(n).
%F Let beta be the time reversal of alpha
%F beta: 0 -> 10, 1 -> 00.
%F By definition, (a(n)) satisfies (a(n)) = 1 beta((a(n))), implying that
%F (*) (a(n)) = 1 beta(1) beta^2(1) beta^3(1) ....
%F Note that Yanev's conjecture can be reformulated as
%F / PD(n) if n is not a power of 2,
%F a(n) = -|
%F \ 1-PD(n) if n is a power of 2.
%F It is easy to see that for all n
%F beta^n(0) = beta^n(1), EXCEPT for the first letter:
%F beta^n(0) = delta(n)R, beta^n(1) = (1-delta(n))R, where
%F delta(2n) = 0, delta(2n+1) = 1.
%F We will use below that, similarly, alpha^n(0) = alpha^n(1), EXCEPT for the LAST letter.
%F From (*) we see now that the conjecture will be proved if one shows that
%F (**) alpha^n(0) = 0 beta(0)beta^2(0)...beta^{n-1}(0) delta(n),
%F since the first letters of the beta^(k) in this concatenation occur exactly at positions 2^k.
%F The formula (**) has a companion
%F (***) beta^n(0) = delta(n) 0 beta(0)beta^2(0)...beta^{n-1}(0).
%F We will prove both formula's together with induction on n.
%F For n=2 (**) and (***) one has to check
%F alpha^2(0)=0beta(0)delta(2)=0100, beta^2(0)=delta(2)0beta(0)=0010,
%F which are true. Suppose (**), (***) hold for some n>1. Then
%F alpha^{n+1}(0) = alpha^n(0) alpha^n(1) =
%F 0 beta(0)beta^2(0)...beta^{n-1}(0) delta(n)0
%F beta(0)beta^2(0)...beta^{n-1}(0) (1-delta(n)) =
%F 0 beta(0)beta^2(0)...beta^n(0) (1-delta(n)) =
%F 0 beta(0)beta^2(0)...beta^n(0)delta(n+1).
%F The formula for (***) with n+1 follows in a similar way.
%F (End)
%t t = {1}; Do[If[EvenQ[n], a = 1 - t[[n/2]], a = 0]; AppendTo[t, a], {n, 2, 100}]; t (* _T. D. Noe_, Oct 10 2012 *)
%o (PARI) A217586(n) = if(1==n,n,if(!(n%2),(1-A217586(n>>1)),0)); \\ _Antti Karttunen_, Sep 30 2018
%Y Cf. A171945.
%Y Cf. A096268 (same rules, but starts with 0), A030300.
%K nonn
%O 1
%A _John W. Layman_, Oct 08 2012
%E More terms from _Antti Karttunen_, Sep 30 2018