OFFSET
1,12
LINKS
Simon Strandgaard, Plot of 1000 terms
EXAMPLE
MATHEMATICA
a[n_] := Mod[FromDigits @ Sort[IntegerDigits[n], Greater], n]; Array[a, 100] (* Amiram Eldar, Jan 30 2021 *)
PROG
(Ruby) values = (1..20).map do |n|
n.to_s.split('').sort.join.reverse.to_i % n
end
p values
(PARI) a(n) = fromdigits(vecsort(digits(n), , 4)) % n; \\ Michel Marcus, Mar 04 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Simon Strandgaard, Jan 28 2021
STATUS
approved