cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356894 a(n) is the number of 0's in the maximal tribonacci representation of n (A352103).

This page as a plain text file.
%I A356894 #12 Sep 05 2022 05:24:32
%S A356894 1,0,1,0,2,1,1,0,2,2,1,2,1,1,0,3,2,3,2,2,1,2,2,1,2,1,1,0,4,3,3,2,3,3,
%T A356894 2,3,2,2,1,3,2,3,2,2,1,2,2,1,2,1,1,0,4,4,3,4,3,3,2,4,3,4,3,3,2,3,3,2,
%U A356894 3,2,2,1,4,3,3,2,3,3,2,3,2,2,1,3,2,3,2
%N A356894 a(n) is the number of 0's in the maximal tribonacci representation of n (A352103).
%H A356894 Amiram Eldar, <a href="/A356894/b356894.txt">Table of n, a(n) for n = 0..10000</a>
%F A356894 a(n) = A356895(n) - A352104(n).
%e A356894   n  a(n)  A352103(n)
%e A356894   -  ----  ----------
%e A356894   0     1           0
%e A356894   1     0           1
%e A356894   2     1          10
%e A356894   3     0          11
%e A356894   4     2         100
%e A356894   5     1         101
%e A356894   6     1         110
%e A356894   7     0         111
%e A356894   8     2        1001
%e A356894   9     2        1010
%t A356894 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 == {}, 1, Count[v[[i[[1, 1]] ;; -1]], 0]]]; Array[a, 100, 0]
%Y A356894 Cf. A000073, A352103, A352104, A356895.
%Y A356894 Similar sequences: A023416, A102364, A117479, A278042.
%K A356894 nonn,base
%O A356894 0,5
%A A356894 _Amiram Eldar_, Sep 03 2022