login
A370873
Positive integers m such that c(0) >= c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.
7
3, 9, 11, 15, 19, 21, 27, 28, 29, 30, 33, 36, 45, 55, 57, 63, 81, 82, 83, 84, 86, 87, 88, 90, 92, 96, 99, 100, 102, 108, 110, 114, 126, 135, 136, 138, 144, 163, 165, 166, 171, 172, 174, 189, 190, 192, 198, 243, 244, 245, 246, 247, 248, 249, 250, 252, 253, 254
OFFSET
1,1
LINKS
EXAMPLE
The ternary representation of 84 is 10010, for which c(0)=3 >= c(1)=2 >= c(2)=0.
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 24 2025
(PARI) select( {is(n, b=3, r=4, c=Vec(0, b))=while(n, c[1+n%b]++; n\=b); c==vecsort(c, , r)}, [1..99]) \\ Optional args allow to chose a different base b, r=0 yields the "reverse" (cf. A370856), c=[1..b] gives the "strict order" variant A370870. - M. F. Hasler, Mar 31 2026
CROSSREFS
Cf. A072601 and A072602: base-2 analogs.
Sequence in context: A106373 A190226 A059326 * A028312 A390154 A310315
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Mar 13 2024
STATUS
approved