login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A337171
a(n) = A004186(n) mod n.
1
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 5, 13, 6, 13, 3, 9, 15, 0, 0, 0, 9, 18, 2, 10, 18, 26, 5, 0, 0, 0, 0, 9, 18, 27, 36, 7, 15, 0, 0, 0, 0, 0, 9, 18, 27, 36, 45, 0, 0, 0, 0, 0, 0, 9, 18, 27, 36, 0, 0, 0, 0, 0, 0, 0, 9, 18, 27, 0, 0, 0, 0, 0, 0, 0, 0, 9, 18
OFFSET
1,12
EXAMPLE
a(12) = A004186(12) mod 12 = 21 mod 12 = 9,
a(13) = A004186(13) mod 13 = 31 mod 13 = 5,
a(14) = A004186(14) mod 14 = 41 mod 14 = 13,
a(15) = A004186(15) mod 15 = 51 mod 15 = 6,
a(16) = A004186(16) mod 16 = 61 mod 16 = 13.
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
Cf. A004186.
Cf. A319650 (similar in binary).
Sequence in context: A378864 A220510 A078086 * A061467 A103168 A298584
KEYWORD
nonn,base
AUTHOR
Simon Strandgaard, Jan 28 2021
STATUS
approved