OFFSET
0,9
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..32768 (terms 0..4096 from Joseph Myers)
EXAMPLE
For n = 11, 11_10 = 13_8. So, a(11) = 31_8 - 13_8 = 25 - 11 = 14. - Indranil Ghosh, Feb 02 2017
MATHEMATICA
a[n_] := With[{dd = IntegerDigits[n, 8]}, FromDigits[ReverseSort[dd], 8] - FromDigits[Sort[dd], 8]];
a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)
PROG
(Python)
def A165090(n):
if n==0:return 0
return int("".join(sorted(oct(n)[2:], reverse=True)), 8)-int("".join(sorted(oct(n)[2:])), 8) # Indranil Ghosh, Feb 02 2017
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Joseph Myers, Sep 04 2009
STATUS
approved