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-3 of 3 results.

A378835 Numbers with the median of the digits equal to the digital root.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 109, 118, 128, 138, 148, 158, 168, 178, 181, 182, 183, 184, 185, 186, 187, 188, 190, 209, 218, 227, 237, 247, 257, 267, 272, 273, 274, 275, 276, 277, 281, 290, 309, 318, 327, 336, 346, 356, 363, 364, 365, 366, 372, 381, 390, 409, 418, 427, 436, 445
Offset: 1

Views

Author

Stefano Spezia, Dec 09 2024

Keywords

Examples

			10 is not in the list because the median of its digits is not integer.
11 is not in the list because the median of its digits is 1 which is not equal to 2, the digital root of 11.
109 is in the list because the median of its digits is 1 which is equal to the digital root of 109.
		

Crossrefs

Programs

  • Mathematica
    A010888[n_]:=If[n==0,0,n - 9*Floor[(n-1)/9]]; Select[Range[0,450], Median[IntegerDigits[#]]==A010888[#] &]

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

Original entry on oeis.org

10, 1, 131, 474, 10233, 50844, 1001250, 5225775, 99980565, 536333508, 9998984322, 55188464010, 999994914558, 5683515922236, 100001648752524, 585428890525092, 10000105972653645, 60302140270087340, 1000004027662440330, 6207976859006478708, 100000111315410065850
Offset: 1

Views

Author

Stefano Spezia, Dec 09 2024

Keywords

Crossrefs

Programs

  • Mathematica
    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[Median[IntegerDigits[k]]==A010888[k], c++]]; c]]; Array[a, 6]
  • Python
    from math import prod, factorial
    from collections import Counter
    from sympy.utilities.iterables import partitions
    def A378836(n):
        if n==1: return 10
        c, f = 0, factorial(n-1)
        for i in range(1,9*n+1):
            for s,p in partitions(i,m=n,k=9,size=True):
                a = sorted(list(Counter(p).elements())+[0]*(n-s))
                b = a[len(a)-1>>1]+a[len(a)>>1]
                if b&1^1 and b>>1 == 1+(i-1)%9:
                    v = list(p.values())
                    p = prod((factorial(i) for i in v))*factorial(n-s)
                    c += sum(f*i//p for i in v)
        return c # Chai Wah Wu, Dec 12 2024

Extensions

a(11)-a(21) from Chai Wah Wu, Dec 12 2024

A378837 Numbers with the arithmetic mean of the digits equal to the digital root.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 999, 1029, 1038, 1047, 1056, 1065, 1074, 1083, 1092, 1119, 1128, 1137, 1146, 1155, 1164, 1173, 1182, 1191, 1209, 1218, 1227, 1236, 1245, 1254, 1263, 1272, 1281, 1290, 1308, 1317, 1326, 1335, 1344, 1353, 1362, 1371, 1380, 1407, 1416, 1425, 1434, 1443
Offset: 1

Views

Author

Stefano Spezia, Dec 09 2024

Keywords

Examples

			10 is not in the list because the mean of its digits is not integer.
11 is not in the list because the mean of its digits is 1 which is not equal to 2, the digital root of 11.
1029 is in the list because the mean of its digits is 3 which is equal to the digital root of 1029.
		

Crossrefs

Programs

  • Mathematica
    A010888[n_]:=If[n==0,0,n - 9*Floor[(n-1)/9]]; Select[Range[0,1500], Mean[IntegerDigits[#]]==A010888[#] &]
Showing 1-3 of 3 results.