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

A371384 a(n) is the denominator of the arithmetic mean of the digits of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 0

Views

Author

Stefano Spezia, Mar 20 2024

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Denominator[Mean[IntegerDigits[n]]]; Array[a,90,0]
  • Python
    from math import gcd
    def A371384(n): return (l:=len(s:=str(n)))//gcd(l,sum(map(int,s))) # Chai Wah Wu, Mar 22 2024

A371462 Numbers such that the arithmetic mean of its digits is equal to the population standard deviation of its digits.

Original entry on oeis.org

0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 1001, 1010, 1014, 1041, 1049, 1094, 1100, 1104, 1140, 1401, 1409, 1410, 1490, 1904, 1940, 2002, 2020, 2028, 2082, 2200, 2208, 2280, 2802, 2820, 3003, 3030, 3300, 4004, 4011, 4019, 4040, 4091, 4101, 4109, 4110, 4190, 4400, 4901, 4910
Offset: 1

Views

Author

Stefano Spezia, Mar 24 2024

Keywords

Comments

Equivalently, numbers whose digits have the coefficient of variation (or relative population standard deviation) equal to 1.
Any number obtained without leading zeros from a permutation of the digits of a given term of the sequence is also a term.
The concatenation of several copies of any term is a term. - Robert Israel, Mar 24 2024

Examples

			1014 is a term since the mean of the digits is (1 + 0 + 1 + 4)/4 = 3/2 and the standard deviation of the digits is sqrt(((1-3/2)^2 + (0-3/2)^2 + (1-3/2)^2 + (4-3/2)^2)/4) = sqrt((1/4 + 9/4 + 1/4 + 25/4)/4) = sqrt(9/4) = 3/2.
		

Crossrefs

Programs

  • Maple
    filter:= proc(x) local F,n,mu,i;
      F:= convert(x,base,10);
      n:= nops(F);
      mu:= convert(F,`+`)/n;
      evalb(2*mu^2 = add(F[i]^2,i=1..n)/n)
    end proc:
    select(filter, [$0..10000]); # Robert Israel, Mar 24 2024
  • Mathematica
    DigStd[n_]:=If[n==0||IntegerLength[n]==1, 0, Sqrt[(IntegerLength[n]-1)/IntegerLength[n]]StandardDeviation[IntegerDigits[n]]]; Select[Range[0, 5000], Mean[IntegerDigits[#]]==DigStd[#]&]
  • Python
    from itertools import count, islice
    def A371462_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:sum(map(int,(s:=str(n))))**2<<1 == len(s)*sum(int(d)**2 for d in s), count(max(startvalue,0)))
    A371462_list = list(islice(A371462_gen(),20)) # Chai Wah Wu, Mar 28 2024

A371463 Numbers such that the arithmetic mean of its digits is equal to twice the population standard deviation of its digits.

Original entry on oeis.org

0, 13, 26, 31, 39, 62, 93, 1133, 1313, 1331, 1779, 1797, 1977, 2266, 2626, 2662, 3113, 3131, 3311, 3399, 3939, 3993, 6226, 6262, 6622, 7179, 7197, 7719, 7791, 7917, 7971, 9177, 9339, 9393, 9717, 9771, 9933, 10111, 11011, 11101, 11110, 11123, 11132, 11213, 11231
Offset: 1

Views

Author

Stefano Spezia, Mar 24 2024

Keywords

Comments

Equivalently, numbers whose digits have the coefficient of variation (or relative population standard deviation) equal to 1/2.
Any number obtained without leading zeros from a permutation of the digits of a given term of the sequence is also a term.
The concatenation of several copies of any term is a term. - Robert Israel, Mar 24 2024

Examples

			1133 is a term since the mean of the digits is (1 + 1 + 3 + 3)/4 = 2 and the standard deviation of the digits is sqrt(((1-2)^2 + (1-2)^2 + (3-2)^2 + (3-2)^2)/4) = 1.
		

Crossrefs

Programs

  • Mathematica
    DigStd[n_]:=If[n==0||IntegerLength[n]==1, 0, Sqrt[(IntegerLength[n]-1)/IntegerLength[n]]StandardDeviation[IntegerDigits[n]]]; Select[Range[0, 12000], Mean[IntegerDigits[#]]==2DigStd[#]&]
  • Python
    from itertools import count, islice
    def A371463_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:5*sum(s:=tuple(map(int,str(n))))**2 == len(s)*sum(d**2 for d in s)<<2, count(max(startvalue,0)))
    A371463_list = list(islice(A371463_gen(),20)) # Chai Wah Wu, Mar 30 2024

A371464 Numbers such that the arithmetic mean of its digits is equal to three times the population standard deviation of its digits.

Original entry on oeis.org

0, 12, 21, 24, 36, 42, 48, 63, 84, 1122, 1212, 1221, 2112, 2121, 2211, 2244, 2424, 2442, 2556, 2565, 2655, 3366, 3447, 3474, 3636, 3663, 3744, 4224, 4242, 4347, 4374, 4422, 4437, 4473, 4488, 4734, 4743, 4848, 4884, 5256, 5265, 5526, 5562, 5625, 5652, 6255, 6336, 6363
Offset: 1

Views

Author

Stefano Spezia, Mar 24 2024

Keywords

Comments

Equivalently, numbers whose digits have the coefficient of variation (or relative population standard deviation) equal to 1/3.
Any number obtained without leading zeros from a permutation of the digits of a given term of the sequence is also a term.
The concatenation of several copies of any term is a term. - Robert Israel, Mar 24 2024

Examples

			2244 is a term since the mean of the digits is (2 + 2 + 4 + 4)/4 = 3 and the standard deviation of the digits is sqrt(((2-3)^2 + (2-3)^2 + (4-3)^2 + (4-3)^2)/4) = 1.
		

Crossrefs

Programs

  • Mathematica
    DigStd[n_]:=If[n==0||IntegerLength[n]==1, 0, Sqrt[(IntegerLength[n]-1)/IntegerLength[n]]StandardDeviation[IntegerDigits[n]]]; Select[Range[0, 6400], Mean[IntegerDigits[#]]==3DigStd[#]&]
  • Python
    from itertools import count, islice
    def A371464_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:10*sum(s:=tuple(map(int,str(n))))**2 == 9*len(s)*sum(d**2 for d in s), count(max(startvalue,0)))
    A371464_list = list(islice(A371464_gen(),20)) # Chai Wah Wu, Mar 30 2024

A383305 a(n) is number of n-digit nonnegative integers whose difference between the largest and smallest digits is equal to the arithmetic mean of its digits.

Original entry on oeis.org

1, 6, 39, 266, 1730, 11361, 74809, 494194, 3273132, 21730506, 144588345, 964050593, 6440655572, 43111601819, 289112380019, 1942335481170, 13072051432742, 88125501965430, 595077180675348, 4024698113281006, 27261843502415806, 184931926767687963, 1256249015578188517, 8545135121520262849, 58198759816476208605
Offset: 1

Views

Author

Stefano Spezia, Apr 22 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{c=KroneckerDelta[n,1]}, For[k=10^(n-1), k<=10^n, k++, If[Max[d=IntegerDigits[k]]-Min[d]==Mean[d], c++]]; c]; Array[a,7]
  • Python
    def A383305(n):
        if n<=1: return n
        s={(k,k,k):1 for k in range(1,10)}
        for i in range(n-1):
            snew={}
            for (h,l,t),v in s.items():
                for d in range(10):
                    p=(max(h,d),min(l,d),t+d)
                    if p in snew:
                        snew[p]+=v
                    else:
                        snew[p]=v
            s=snew
        return sum( v for (h,l,t),v in s.items() if n*(h-l)==t) # Bert Dobbelaere, Apr 25 2025

Extensions

More terms from Bert Dobbelaere, Apr 25 2025

A383304 Nonnegative integers whose difference between the largest and smallest digits is equal to the arithmetic mean of its digits.

Original entry on oeis.org

0, 13, 26, 31, 39, 62, 93, 123, 132, 144, 213, 225, 231, 246, 252, 264, 267, 276, 288, 312, 321, 348, 369, 384, 396, 414, 426, 438, 441, 462, 483, 522, 624, 627, 639, 642, 672, 693, 726, 762, 828, 834, 843, 882, 936, 963, 1133, 1223, 1232, 1313, 1322, 1331, 1344, 1434, 1443
Offset: 1

Views

Author

Stefano Spezia, Apr 22 2025

Keywords

Examples

			144 is a term since 4 - 1 = 3 = (1 + 4 + 4)/3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,1500], Max[d=IntegerDigits[#]]-Min[d]==Mean[d] &]
  • Python
    def ok(n): return sum(d:=list(map(int, str(n)))) == (max(d) - min(d))*len(d)
    print([k for k in range(1500) if ok(k)]) # Michael S. Branicky, Apr 23 2025
Showing 1-6 of 6 results.