OFFSET
0,10
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..8191
PROG
(Ruby)
def A(k, n)
(0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k) - i}
end
p A(2, 100)
(PARI) a(n) = fromdigits(vecsort(binary(n), , 4), 2) - n; \\ Michel Marcus, Sep 25 2018
CROSSREFS
KEYWORD
AUTHOR
Seiichi Manyama, Sep 25 2018
STATUS
approved