login
A356899
Nonnegative numbers whose minimal and maximal tribonacci representations are the same.
2
0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 21, 22, 23, 28, 29, 30, 32, 33, 34, 35, 36, 39, 40, 41, 42, 43, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 66, 67, 72, 73, 74, 76, 77, 78, 79, 80, 96, 97, 98, 99, 100, 102, 103, 104, 109, 110, 111, 113
OFFSET
1,3
LINKS
MATHEMATICA
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]];
tribmin[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]; FromDigits@IntegerDigits[Total[2^(s - 1)], 2]];
tribmax[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, FromDigits[v[[i[[1, 1]] ;; -1]]]]];
Select[Range[0, 150], tribmin[#] == tribmax[#] &]
CROSSREFS
A089068 is a subsequence.
Similar sequence: A000071 (numbers whose Zeckendorf and dual Zeckendorf representations are the same).
Sequence in context: A157465 A257247 A269164 * A230780 A302540 A332487
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Sep 03 2022
STATUS
approved