A370919 Positive integers whose ternary representation includes at least one 1, and every 1 is followed by 2.
5, 15, 17, 23, 45, 47, 50, 51, 53, 59, 69, 71, 77, 135, 137, 140, 141, 143, 150, 152, 153, 155, 158, 159, 161, 167, 177, 179, 185, 207, 209, 212, 213, 215, 221, 231, 233, 239, 405, 407, 410, 411, 413, 420, 422, 423, 425, 428, 429, 431, 450, 452, 455, 456
Offset: 1
Examples
The ternary representations of 5, 15, and 17 are 12, 120, and 122.
Programs
-
Mathematica
Map[#[[1]] &, Select[Map[{#, #[[1]] > 0 && #[[1]] == #[[2]] &[{Length[ StringCases[#, "1"]], Length[StringCases[#, "12"]]}] &[ IntegerString[#, 3]]} &, Range[500]], #[[2]] &]] (* Peter J. C. Moses, Mar 05 2024 *)