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.

This page as a plain text file.
%I A337171 #19 Mar 18 2021 08:22:41
%S A337171 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,
%T A337171 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,
%U A337171 0,0,0,0,0,0,9,18,27,0,0,0,0,0,0,0,0,9,18
%N A337171 a(n) = A004186(n) mod n.
%H A337171 Simon Strandgaard, <a href="/A337171/a337171.png">Plot of 1000 terms</a>
%e A337171 a(12) = A004186(12) mod 12 = 21 mod 12 = 9,
%e A337171 a(13) = A004186(13) mod 13 = 31 mod 13 = 5,
%e A337171 a(14) = A004186(14) mod 14 = 41 mod 14 = 13,
%e A337171 a(15) = A004186(15) mod 15 = 51 mod 15 = 6,
%e A337171 a(16) = A004186(16) mod 16 = 61 mod 16 = 13.
%t A337171 a[n_] := Mod[FromDigits @ Sort[IntegerDigits[n], Greater], n]; Array[a, 100] (* _Amiram Eldar_, Jan 30 2021 *)
%o A337171 (Ruby) values = (1..20).map do |n|
%o A337171     n.to_s.split('').sort.join.reverse.to_i % n
%o A337171 end
%o A337171 p values
%o A337171 (PARI) a(n) = fromdigits(vecsort(digits(n), , 4)) % n; \\ _Michel Marcus_, Mar 04 2021
%Y A337171 Cf. A004186.
%Y A337171 Cf. A319650 (similar in binary).
%K A337171 nonn,base
%O A337171 1,12
%A A337171 _Simon Strandgaard_, Jan 28 2021