login
Write n in 7-ary, sort digits into decreasing order.
9

%I #16 Aug 07 2024 10:34:41

%S 0,1,2,3,4,5,6,7,8,15,22,29,36,43,14,15,16,23,30,37,44,21,22,23,24,31,

%T 38,45,28,29,30,31,32,39,46,35,36,37,38,39,40,47,42,43,44,45,46,47,48,

%U 49,56,105,154,203,252,301,56,57,106,155,204,253,302,105,106,113,162

%N Write n in 7-ary, sort digits into decreasing order.

%H Seiichi Manyama, <a href="/A319724/b319724.txt">Table of n, a(n) for n = 0..2400</a>

%F n <= a(n) < 7n. - _Charles R Greathouse IV_, Aug 07 2024

%t Table[FromDigits[ReverseSort[IntegerDigits[n, 7]], 7], {n, 0, 100}] (* _Paolo Xausa_, Aug 07 2024 *)

%o (Ruby)

%o def A(k, n)

%o (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}

%o end

%o p A(7, 100)

%o (PARI) a(n) = fromdigits(vecsort(digits(n, 7), , 4), 7); \\ _Michel Marcus_, Sep 26 2018

%Y b-ary: A073138 (b=2), A319651 (b=3), A319720 (b=4), A319722 (b=5), A319723 (b=6), this sequence (b=7), A319725 (b=8), A319726 (b=9), A004186 (b=10).

%Y Cf. A165071, A319655.

%K nonn,base,look,easy

%O 0,3

%A _Seiichi Manyama_, Sep 26 2018