login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A319720
Write n in 4-ary, sort digits into decreasing order.
8
0, 1, 2, 3, 4, 5, 9, 13, 8, 9, 10, 14, 12, 13, 14, 15, 16, 20, 36, 52, 20, 21, 37, 53, 36, 37, 41, 57, 52, 53, 57, 61, 32, 36, 40, 56, 36, 37, 41, 57, 40, 41, 42, 58, 56, 57, 58, 62, 48, 52, 56, 60, 52, 53, 57, 61, 56, 57, 58, 62, 60, 61, 62, 63, 64, 80, 144, 208, 80, 84
OFFSET
0,3
LINKS
FORMULA
n <= a(n) < 4n. - Charles R Greathouse IV, Aug 07 2024
MATHEMATICA
Table[FromDigits[ReverseSort[IntegerDigits[n, 4]], 4], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
PROG
(Ruby)
def A(k, n)
(0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
end
p A(4, 100)
(PARI) a(n) = fromdigits(vecsort(digits(n, 4), , 4), 4); \\ Michel Marcus, Sep 26 2018
CROSSREFS
b-ary: A073138 (b=2), A319651 (b=3), this sequence (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), A319725 (b=8), A319726 (b=9), A004186 (b=10).
Sequence in context: A101526 A264994 A331364 * A140298 A253181 A107365
KEYWORD
nonn,base,easy
AUTHOR
Seiichi Manyama, Sep 26 2018
STATUS
approved