login
Number of 0's in tribonacci representation of n (cf. A278038).
5

%I #9 Mar 04 2022 04:21:17

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

%T 2,3,2,4,3,3,2,3,2,2,6,5,5,4,5,4,4,5,4,4,3,4,3,5,4,4,3,4,3,3,4,3,3,2,

%U 5,4,4,3,4,3,3,4,3,3,2,3,2,7,6,6,5,6,5,5,6,5,5,4,5,4,6,5,5,4,5,4

%N Number of 0's in tribonacci representation of n (cf. A278038).

%H N. J. A. Sloane, <a href="/A278042/b278042.txt">Table of n, a(n) for n = 0..20000</a>

%t t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; a[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; DigitCount[Total[2^(s - 1)], 2, 0]]; Array[a, 100, 0] (* _Amiram Eldar_, Mar 04 2022 *)

%Y Cf. A278038, A278043, A278044.

%K nonn,base

%O 0,5

%A _N. J. A. Sloane_, Nov 18 2016