OFFSET
0,3
COMMENTS
LINKS
FORMULA
a(n) = n iff n = 0 or n belongs to A125289.
EXAMPLE
For n = 10251:
- the set of nonzero digits is { 1, 2, 5},
- so we replace each digit 1, 2, 5 respectively by 5, 2, 1,
- and a(10251) = 50215.
PROG
(PARI) a(n, base=10) = { my (d=digits(n, base), s=Set(select(sign, d))); fromdigits(apply (t -> if (t, s[#s+1-setsearch (s, t)], 0), d), base) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 09 2020
STATUS
approved