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.

A379181 a(n) is the number of n-digit nonnegative integers with mode and mean of the digits equal.

This page as a plain text file.
%I A379181 #27 Jul 25 2025 09:06:18
%S A379181 10,9,9,237,1617,15099,98490,855675,7020429,68359815,638064114,
%T A379181 6014495595,55556308754,504305784381,4627364658702,42696037939075,
%U A379181 402860074430853,3847842858816523,36989026236202050,355682935667617515,3396760984948340678,32234267063991934093
%N A379181 a(n) is the number of n-digit nonnegative integers with mode and mean of the digits equal.
%H A379181 Chai Wah Wu, <a href="/A379181/b379181.txt">Table of n, a(n) for n = 1..73</a>
%F A379181 Conjecture: a(n+1)/a(n) ~ 10. - _Stefano Spezia_, Jul 23 2025
%t A379181 a[n_]:=Module[{c=KroneckerDelta[n,1]}, For[k=10^(n-1), k<=10^n-1, k++, If[Commonest[IntegerDigits[k]]=={Mean[IntegerDigits[k]]}, c++]]; c]; Array[a,6]
%o A379181 (Python)
%o A379181 from math import factorial, prod
%o A379181 from collections import Counter
%o A379181 from sympy.utilities.iterables import partitions
%o A379181 def A379181(n):
%o A379181     if n == 1: return 10
%o A379181     c, f = 0, factorial(n-1)
%o A379181     for k in range(1,10):
%o A379181         for s,p in partitions(k*n,m=n,k=9,size=True):
%o A379181             v = list(p.values())
%o A379181             if n-s>0: p[0]=n-s
%o A379181             r = Counter(p).most_common(2)
%o A379181             if r[0][0]==k and (len(r)==1 or r[1][1]<r[0][1]):
%o A379181                 w = prod((factorial(i) for i in v))*factorial(n-s)
%o A379181                 c += sum(f*i//w for i in v)
%o A379181     return c # _Chai Wah Wu_, Dec 21 2024
%Y A379181 Cf. A378564, A378836, A379180.
%K A379181 nonn,base
%O A379181 1,1
%A A379181 _Stefano Spezia_, Dec 17 2024
%E A379181 a(11)-a(22) from _Chai Wah Wu_, Dec 21 2024