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.

A378838 a(n) is the number of n-digit nonnegative integers with the mean of the digits equal to the digital root.

This page as a plain text file.
%I A378838 #40 Dec 16 2024 02:07:17
%S A378838 10,1,1,748,1,1,373327,1,1,900000000,1,1,118641180477,1,1,
%T A378838 70265700376176,1,1,473609016175792282,1,1,25843609164809475416,1,1,
%U A378838 15917111940073972644247,1,1,319908753084273214311674685,1,1,6159986083122001233681300544,1,1,3860982462614939076156553701616,1,1
%N A378838 a(n) is the number of n-digit nonnegative integers with the mean of the digits equal to the digital root.
%H A378838 Chai Wah Wu, <a href="/A378838/b378838.txt">Table of n, a(n) for n = 1..81</a>
%F A378838 Conjecture: a(A007494(n)) = 1.
%F A378838 From _Chai Wah Wu_, Dec 12 2024: (Start)
%F A378838 The above conjecture is true, i.e. if n == 0 or 2 mod 3, then a(n) = 1.
%F A378838 Proof: if m is a n-digit integer with mean of digits equal to its digital root k, then sum of digits of m is k*n.
%F A378838 Then m mod 9 = k*n mod 9. Since the digital root is k = 1 + (m-1) mod 9, this means that k = 1 + (k*n-1) mod 9. As 1<=k<=9, for n == 2, 3, 5, 6, 8, 9 mod 9 the only k that satisfies this equation is k=9. Then the only corresponding m whose digit sum is 9*n is 10^n-1. Thus a(n) = 1.
%F A378838 Other results:
%F A378838 Theorem 1: If n == 4 or 7 mod 9, then a(n) is the number of n-digit nonnegative integers with digit sum a multiple of 3*n.
%F A378838 Proof: Follows from the fact that the only k that satisfies k = 1 + (k*n-1) mod 9 is k = 3, 6, or 9.
%F A378838 Theorem 2: If n>1 and n == 1 mod 9, then a(n) is the number of n-digit nonnegative integers with digit sum a multiple of n.
%F A378838 Proof: Since n>1, the digital root of an n-digit integer is > 0. The result then follows from the fact that k = 1 + (k*n-1) mod 9 is satisfied for all 1<=k<=9.
%F A378838 (End)
%t A378838 A010888[n_]:=If[n==0,0,n - 9*Floor[(n-1)/9]]; a[n_]:=If[n==1,10,Module[{c=0}, For[k=10^(n-1), k<=10^n-1, k++, If[Mean[IntegerDigits[k]]==A010888[k], c++]]; c]]; Array[a, 6]
%o A378838 (Python)
%o A378838 from math import prod, factorial
%o A378838 from sympy.utilities.iterables import partitions
%o A378838 def A378838(n):
%o A378838     if n==1: return 10
%o A378838     if n%3!=1: return 1
%o A378838     k, c, f = n%9, 0, factorial(n-1)
%o A378838     a = 3*n if k==4 or k==7 else n
%o A378838     for i in range(a,9*n+1,a):
%o A378838         for s,p in partitions(i,m=n,k=9,size=True):
%o A378838             v = list(p.values())
%o A378838             p = prod((factorial(i) for i in v))*factorial(n-s)
%o A378838             c += sum(f*i//p for i in v)
%o A378838     return c # _Chai Wah Wu_, Dec 12 2024
%Y A378838 Cf. A007494, A010888, A378837.
%Y A378838 Cf. A378560, A378564, A378835, A378836.
%K A378838 nonn,base
%O A378838 1,1
%A A378838 _Stefano Spezia_, Dec 09 2024
%E A378838 a(11)-a(36) from _Chai Wah Wu_, Dec 12 2024