cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A337171 a(n) = A004186(n) mod n.

Original entry on oeis.org

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

Views

Author

Simon Strandgaard, Jan 28 2021

Keywords

Examples

			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.
		

Crossrefs

Cf. A004186.
Cf. A319650 (similar in binary).

Programs

  • Mathematica
    a[n_] := Mod[FromDigits @ Sort[IntegerDigits[n], Greater], n]; Array[a, 100] (* Amiram Eldar, Jan 30 2021 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n), , 4)) % n; \\ Michel Marcus, Mar 04 2021
  • Ruby
    values = (1..20).map do |n|
        n.to_s.split('').sort.join.reverse.to_i % n
    end
    p values