%I #7 Dec 07 2019 12:18:29
%S 1,1,0,2,-1,2,2,4,-3,3,3,5,0,7,2,11,-7,8,6,11,0,14,2,19,-5,19,7,26,-5,
%T 28,9,39,-18,32,15,40,-2,46,5,57,-11,57,14,71,-12,73,17,92,-24,87,24,
%U 106,-12,113,19,139,-31,134,33,162,-19,171,30,210,-57,192,50,224,-17,239,25
%N a(0) = a(1) = 1; a(2*n) = a(n) - a(n-1), a(2*n+1) = Sum_{k=0..n} a(n-k).
%C Sequence has its first differences and its partial sums as bisections.
%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>
%F a(n) = Sum_{k=0..n} a(2*k).
%F a(n) = a(2*n+1) - a(2*n-1).
%F a(2*n+1) = Sum_{k=0..n} Sum_{m=0..k} a(2*m).
%e a(0) = a(1) = 1 by definition;
%e a(2) = a(2*1) = a(1) - a(0) = 0;
%e a(3) = a(2*1+1) = a(0) + a(1) = 2;
%e a(4) = a(2*2) = a(2) - a(1) = -1;
%e a(5) = a(2*2+1) = a(0) + a(1) + a(2) = 2;
%e a(6) = a(2*3) = a(3) - a(2) = 2, etc.
%t a[0] = 1; a[1] = 1; a[n_] := a[n] = If[EvenQ[n], a[n/2] - a[(n - 2)/2], Sum[a[(n - 1)/2 - k], {k, 0, (n - 1)/2}]]; Table[a[n], {n, 0, 70}]
%o (Python)
%o def a(n): return 1 if n<2 else a(n/2) - a(n/2 - 1) if n%2==0 else sum([a((n - 1)/2 - k) for k in range((n + 1)/2)]) # _Indranil Ghosh_, Jun 08 2017
%Y Cf. A030067, A086449, A086450, A109671.
%K sign
%O 0,4
%A _Ilya Gutkovskiy_, Jun 07 2017
|