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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

10, 9, 9, 237, 1617, 15099, 98490, 855675, 7020429, 68359815, 638064114, 6014495595, 55556308754, 504305784381, 4627364658702, 42696037939075, 402860074430853, 3847842858816523, 36989026236202050, 355682935667617515, 3396760984948340678, 32234267063991934093
Offset: 1

Views

Author

Stefano Spezia, Dec 17 2024

Keywords

Crossrefs

Programs

  • Mathematica
    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]
  • Python
    from math import factorial, prod
    from collections import Counter
    from sympy.utilities.iterables import partitions
    def A379181(n):
        if n == 1: return 10
        c, f = 0, factorial(n-1)
        for k in range(1,10):
            for s,p in partitions(k*n,m=n,k=9,size=True):
                v = list(p.values())
                if n-s>0: p[0]=n-s
                r = Counter(p).most_common(2)
                if r[0][0]==k and (len(r)==1 or r[1][1]Chai Wah Wu, Dec 21 2024

Formula

Conjecture: a(n+1)/a(n) ~ 10. - Stefano Spezia, Jul 23 2025

Extensions

a(11)-a(22) from Chai Wah Wu, Dec 21 2024
Showing 1-1 of 1 results.