login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; a(2n) = -a(n); a(2n+1) = -a(n) + a(n+1).
5

%I #17 Nov 24 2017 04:32:25

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

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

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

%N a(1) = 1; a(2n) = -a(n); a(2n+1) = -a(n) + a(n+1).

%H J.P. Allouche and M. Mendes France, <a href="http://arxiv.org/abs/1202.0211">Stern-Brocot polynomials and power series</a>, arXiv preprint arXiv:1202.0211 [math.NT], 2012. - From _N. J. A. Sloane_, May 10 2012

%F Let M = an infinite lower triangular matrix with (1, -1, -1, 0, 0, 0,...) in every column, shifted down twice for columns k >1. Then the sequence is the left-shifted vector of Lim_{n->inf} M^n.

%F G.f.: x*Product_{k>=0} (1 - x^(2^k) - x^(2^(k + 1))). - _Ilya Gutkovskiy_, Aug 30 2017

%e a(6) = 2 = (-1)*a(3) = (-1)*(-2). a(7) = 3 = (-1)*a(3) + a(4) = (-1)*(-2) + 1.

%p A177219 := proc(n)

%p local npr ;

%p npr := floor(n/2) ;

%p if n = 1 then

%p 1;

%p elif type(n,'even') then

%p -procname(npr) ;

%p else

%p -procname(npr)+procname(npr+1) ;

%p end if;

%p end proc: # _R. J. Mathar_, Mar 14 2014

%t a[1] = 1; a[n_] := a[n] = If[EvenQ[n], -a[n/2], -a[(n-1)/2]+a[(n-1)/2+1]];

%t Array[a, 80] (* _Jean-François Alcover_, Nov 24 2017 *)

%K sign,easy

%O 1,3

%A _Gary W. Adamson_, May 04 2010