login
a(0) = 0, a(1) = 1; a(2*n) = a(n), a(2*n+1) = 4*a(n) + a(n+1).
9

%I #11 Mar 30 2021 19:01:22

%S 0,1,1,5,1,9,5,21,1,13,9,41,5,41,21,85,1,17,13,61,9,77,41,169,5,61,41,

%T 185,21,169,85,341,1,21,17,81,13,113,61,253,9,113,77,349,41,333,169,

%U 681,5,81,61,285,41,349,185,761,21,253,169,761,85,681,341,1365,1,25,21,101,17

%N a(0) = 0, a(1) = 1; a(2*n) = a(n), a(2*n+1) = 4*a(n) + a(n+1).

%H Alois P. Heinz, <a href="/A342634/b342634.txt">Table of n, a(n) for n = 0..16384</a>

%F G.f.: x * Product_{k>=0} (1 + x^(2^k) + 4*x^(2^(k+1))).

%F a(n) == 1 (mod 4) for n >= 1. - _Hugo Pfoertner_, Mar 17 2021

%p a:= proc(n) option remember; `if`(n<2, n, (q->

%p `if`(d=1, 4*a(q)+a(q+1), a(q)))(iquo(n, 2, 'd')))

%p end:

%p seq(a(n), n=0..68); # _Alois P. Heinz_, Mar 17 2021

%t a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], a[n/2], 4 a[(n - 1)/2] + a[(n + 1)/2]]; Table[a[n], {n, 0, 68}]

%t nmax = 68; CoefficientList[Series[x Product[(1 + x^(2^k) + 4 x^(2^(k + 1))), {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x]

%Y Cf. A002487, A116528, A178243, A342603, A342633, A342635, A342636, A342637, A342638.

%K nonn

%O 0,4

%A _Ilya Gutkovskiy_, Mar 17 2021