A370921 Positive integers in whose ternary representation, 2 occurs at least once, and every 2 is followed by 1.
7, 16, 21, 22, 34, 43, 48, 49, 63, 64, 66, 67, 70, 88, 97, 102, 103, 115, 124, 129, 130, 144, 145, 147, 148, 151, 189, 190, 192, 193, 196, 198, 199, 201, 202, 205, 210, 211, 250, 259, 264, 265, 277, 286, 291, 292, 306, 307, 309, 310, 313, 331, 340, 345, 346
Offset: 1
Examples
The ternary representations of 7, 16, and 21 are 21, 121, and 210.
Programs
-
Mathematica
Map[#[[1]] &, Select[Map[{#, #[[1]] > 0 && #[[1]] == #[[2]] &[{Length[ StringCases[#, "2"]], Length[StringCases[#, "21"]]}] &[ IntegerString[#, 3]]} &, Range[500]], #[[2]] &]] (* Peter J. C. Moses, Mar 05 2024 *)