login
For a binary reflected Gray code, the (Hamming/Euclidean) distance between 2 subsequent points x and y is 1, say in coordinate k. If y has a 1 in coordinate k and x has a 0, than (x,y) is indicated by k, if it is the other way around, (x,y) is indicated by -k. The sequence has a fractal character such that G(d+1) = G(d) d+1 R(G(d)) where R(G(d)) alters d --> -d and leaves all other numbers invariant.
4

%I #23 Sep 08 2019 02:59:17

%S 1,2,-1,3,1,-2,-1,4,1,2,-1,-3,1,-2,-1,5,1,2,-1,3,1,-2,-1,-4,1,2,-1,-3,

%T 1,-2,-1,6,1,2,-1,3,1,-2,-1,4,1,2,-1,-3,1,-2,-1,-5,1,2,-1,3,1,-2,-1,

%U -4,1,2,-1,-3,1,-2,-1,7,1,2,-1,3,1,-2,-1,4,1,2,-1,-3,1,-2,-1,5

%N For a binary reflected Gray code, the (Hamming/Euclidean) distance between 2 subsequent points x and y is 1, say in coordinate k. If y has a 1 in coordinate k and x has a 0, than (x,y) is indicated by k, if it is the other way around, (x,y) is indicated by -k. The sequence has a fractal character such that G(d+1) = G(d) d+1 R(G(d)) where R(G(d)) alters d --> -d and leaves all other numbers invariant.

%C This is the paper-folding sequence Fold(1,2,3,4,5,...). It is also the fixed point of the map 1->1,2; 2->-1,3; 3->-1,4; 4->-1,5; ...; -1->1,-2; -2->-1,-3; -3->-1,-4; -4->-1,-5; ... [Allouche and Shallit]. - _N. J. A. Sloane_, Jul 27 2012

%C Multiplicative because both A034947 and A001511 are. - _Andrew Howroyd_, Aug 06 2018

%D J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 203, Exercise 15.

%H Alois P. Heinz, <a href="/A164677/b164677.txt">Table of n, a(n) for n = 1..8192</a>

%H <a href="/index/Fo#fold">Index entries for sequences obtained by enumerating foldings</a>

%F a(n) = (-1)^chi_A091067(n)*A001511(n), where chi_A091067 is the characteristic function of A091067. - _M. F. Hasler_, Aug 06 2015

%F a(n) = A034947(n)*A001511(n). - _Andrew Howroyd_, Aug 06 2018

%t a[n_] := KroneckerSymbol[-1, n] * IntegerExponent[2n, 2];

%t Array[a, 80] (* _Jean-François Alcover_, Sep 08 2019 *)

%o (PARI) A164677(n)=(valuation(n,2)+1)*if(n>>valuation(n,2)%4==3,-1,1) \\ _M. F. Hasler_, Aug 06 2015

%Y Absolute values give A001511.

%Y Indices of negative terms are listed in A091067. - _M. F. Hasler_, Aug 06 2015

%Y Cf. A034947.

%K easy,sign,mult

%O 1,2

%A _Arie Bos_, Aug 20 2009

%E More terms from _Alois P. Heinz_, Jan 30 2012