login
A370861
Numbers m such that c(0) < c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.
4
1, 4, 5, 7, 10, 12, 13, 14, 16, 22, 31, 32, 34, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 50, 52, 58, 64, 66, 67, 68, 70, 76, 85, 91, 93, 94, 95, 97, 98, 103, 104, 106, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 127, 128, 129
OFFSET
1,2
LINKS
EXAMPLE
The ternary representation of 16 is 121, for which c(0)=0 < c(1)=2 >= c(2)=1.
MATHEMATICA
Select[Range[1000], DigitCount[#, 3, 0] < DigitCount[#, 3, 1] >= DigitCount[#, 3, 2] &]
PROG
(MATLAB) nmax = 1000; n = 1:nmax; for k = 1:nmax, c = arrayfun(@(m) sum(dec2base(k, 3)-'0'==m), 0:2); tf(k) = c(1)<c(2) && c(2)>=c(3); end, a = n(tf); % Chris R. Rehmann, Oct 22 2025
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Mar 03 2024
STATUS
approved