OFFSET
1,2
COMMENTS
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
REFERENCES
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 203, Exercise 15.
LINKS
FORMULA
a(n) = (-1)^chi_A091067(n)*A001511(n), where chi_A091067 is the characteristic function of A091067. - M. F. Hasler, Aug 06 2015
MATHEMATICA
a[n_] := KroneckerSymbol[-1, n] * IntegerExponent[2n, 2];
Array[a, 80] (* Jean-François Alcover, Sep 08 2019 *)
PROG
(PARI) A164677(n)=(valuation(n, 2)+1)*if(n>>valuation(n, 2)%4==3, -1, 1) \\ M. F. Hasler, Aug 06 2015
CROSSREFS
KEYWORD
easy,sign,mult
AUTHOR
Arie Bos, Aug 20 2009
EXTENSIONS
More terms from Alois P. Heinz, Jan 30 2012
STATUS
approved