%I #43 Mar 01 2023 06:19:47
%S 1,0,1,1,1,0,2,1,2,1,1,1,2,0,3,2,3,1,3,2,2,1,2,1,3,1,2,2,3,0,5,3,5,2,
%T 4,3,4,1,5,3,4,2,3,2,3,1,3,2,4,1,4,3,3,1,4,2,5,2,3,3,5,0,8,5,8,3,7,5,
%U 6,2,7,4,7,3,5,4,6,1,8,5,7,3,6,4,5,2,5,3,5,2,4,3,4,1,5,3,6,2,5,4,5,1,7
%N Diagonal sums of number triangle A106344.
%C This is a "bow" sequence, a companion to A281185. - _N. J. A. Sloane_, Apr 26 2017
%C Number of ways of writing n=sum_i c_i*2^i with c_i in {0,2,3} [Anders]. - _R. J. Mathar_, Mar 01 2023
%H Rémy Sigrist, <a href="/A106345/b106345.txt">Table of n, a(n) for n = 0..25000</a>
%H K. Anders, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Anders/anders9.html">Counting Non-Standard Binary Representations</a>, JIS vol 19 (2016) #16.3.3 example 7.
%H George Beck and Karl Dilcher, <a href="https://arxiv.org/abs/2106.10400">A Matrix Related to Stern Polynomials and the Prouhet-Thue-Morse Sequence</a>, arXiv:2106.10400 [math.CO], 2021.
%H Melissa Dennison, <a href="https://www.emis.de/journals/JIS/VOL22/Dennison/dennis3.html">On Properties of the General Bow Sequence</a>, J. Int. Seq., Vol. 22 (2019), Article 19.2.7.
%F a(n) = Sum_{k=0..floor(n/2)} (binomial(k, n-2k) mod 2).
%F G.f. A(x) satisfies: A(x) = (1 + x^2 + x^3) * A(x^2). - _Ilya Gutkovskiy_, Jul 09 2019
%p f:=proc(n) option remember;
%p if n=0 then 0
%p elif n=1 then 0
%p elif n=2 then 1
%p else
%p if n mod 2 = 0 then f(n/2)+f(1+n/2) else f((n-1)/2) fi;
%p fi;
%p end;
%p [seq(f(n),n=2..150)]; # (Note that with this recurrence, we list the values starting at n = 2. _N. J. A. Sloane_, Apr 26 2017
%t Table[Sum[Mod[Binomial[k, n-2k], 2], {k, 0, n/2}], {n, 0, 102}] (* _Jean-François Alcover_, Nov 16 2019 *)
%o (Python)
%o a = [0]*(104*2)
%o a[1]=1
%o for n in range(1,104):
%o a[2*n ]=a[n-1]
%o a[2*n+1]=a[n]+a[n+1]
%o print(str(a[n]), end=',')
%o # _Alex Ratushnyak_, Jul 04 2012
%Y Cf. A002487, A281185.
%K nonn,look,easy
%O 0,7
%A _Paul Barry_, Apr 29 2005
|