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.
%I A375575 #17 Sep 15 2024 20:24:26 %S A375575 1,1,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1, %T A375575 -1,2,-1,-1,7,0,4,-1,-1,-1,-1,-1,-1,8,-1,-1,-1,8,-1,-1,9,-1,-1,0,9,9, %U A375575 -1,-1,-1,1,-1,-1,2,-1,-1,5,5,1,4,5,7,-1,5,-1,6,6,0,-1,5,9,6,-1,0,5,9 %N A375575 a(n) is the least frequent digit of n! not counting trailing zeros, or -1 if there is more than one least frequent digit. %C A375575 Analogous to A375348. %C A375575 If we were to count trailing zeros, then a(n) would never equal zero, for all n's >= 0. Therefore we only consider the decimal digits of A004154. %C A375575 Conjecture: excluding -1, as n -> oo, the digits distribution is uniform as in A375348. %e A375575 a(0) = a(1) = 1 because 0! = 1! = 1 and 1 is the only digit present; %e A375575 a(4) = -1 since 4! = 24 and there are two least frequent digits, 2 and 4. %e A375575 a(14) = 9 because 14! = 87178291200 and, not counting the two trailing 0's, there are two 1's, two 2's, two 7's, two 8's but only one 9. %p A375575 f:= proc(n) local L,j; %p A375575 L:= convert(n!,base,10); %p A375575 for j from 1 while L[j] = 0 do od: %p A375575 L:= Statistics:-Tally(L[j...-1]); %p A375575 L:= sort(L,(a,b) -> rhs(a) < rhs(b)); %p A375575 if nops(L) >= 2 and rhs(L[2]) = rhs(L[1]) then -1 else lhs(L[1]) fi %p A375575 end proc: %p A375575 map(f, [$0..100]); # _Robert Israel_, Sep 02 2024 %t A375575 Rarest[lst_] := MinimalBy[ Tally[lst], Last][[All, 1]]; a[n_] := If[ Length[c = Rarest[ IntegerDigits[n!/10^IntegerExponent[n!, 10]] ]] >1, -1, c[[1]]]; Array[a, 80, 0] %o A375575 (Python) %o A375575 from collections import Counter %o A375575 from sympy import factorial %o A375575 def A375575(n): return -1 if len(k:=Counter(str(factorial(n)).rstrip('0')).most_common()) > 1 and k[-1][1]==k[-2][1] else int(k[-1][0]) # _Chai Wah Wu_, Sep 15 2024 %Y A375575 Cf. A004154, A027869, A031144, A034886, A061010, A137579, A137580, A375348. %K A375575 base,easy,sign %O A375575 0,3 %A A375575 _Stefano Spezia_ and _Robert G. Wilson v_, Aug 19 2024