login
a(n) is the number of 1's in the maximal tribonacci representation of n (A352103).
9

%I #11 Mar 07 2022 19:00:09

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

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

%U 4,5,5,6,3,4,4,5,4,4,5,4,5,5,6,4,5,4,5

%N a(n) is the number of 1's in the maximal tribonacci representation of n (A352103).

%H Amiram Eldar, <a href="/A352104/b352104.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A007953(A352103(n)).

%F a(n) >= A278043(n).

%t t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[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]; IntegerDigits[Total[2^(s - 1)], 2]]; a[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, Total[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 100, 0]

%Y Cf. A000073, A007953, A352103.

%Y Similar sequences: A000120, A007895, A112310, A278043.

%K nonn,base

%O 0,4

%A _Amiram Eldar_, Mar 05 2022