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

A238616 Number of partitions of n having standard deviation σ < 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 15, 19, 23, 25, 33, 41, 44, 51, 58, 67, 78, 84, 99, 117, 124, 132, 155, 186, 202, 219, 244, 268, 290, 317, 344, 396, 427, 449, 501, 557, 597, 639, 714, 752, 824, 885, 948, 1031, 1084, 1185, 1308, 1390, 1452, 1589, 1692, 1788, 1919
Offset: 1

Views

Author

Clark Kimberling, Mar 01 2014

Keywords

Comments

Here, "standard deviation" means "population standard deviation" (denoted by σ), not "sample standard deviation" (denoted by s); σ is the square root of variance, so that σ of a list t = (t(k)), such as the partitions of a positive integer, is given by the formula sqrt((Sum_{k=1..#t} (t(k) - mean(t))^2)/(#t)), where #t is the number of terms in t(k). (The distinction between σ and s is discussed in most probability and statistics textbooks. The command "StandardDeviation" in Mathematica gives s, not σ.)

Examples

			There are 11 partitions of 6, whose standard deviations are given by these approximations: 0, 2, 1, 1.41421, 0, 0.816497, 0.866025, 0, 0.5, 0.4, 0, so that a(6) = 8.
		

Crossrefs

Column k=0 of A239223.

Programs

  • Maple
    b:= proc(n, i, m, s, c) `if`(n=0, `if`(s/c-(m/c)^2<1, 1, 0),
          `if`(i=1, b(0$2, m+n, s+n, c+n), add(b(n-i*j, i-1,
           m+i*j, s+i^2*j, c+j), j=0..n/i)))
        end:
    a:= n-> b(n$2, 0$3):
    seq(a(n), n=1..55);  # Alois P. Heinz, Mar 12 2014
  • Mathematica
    z = 55; g[n_] := g[n] = IntegerPartitions[n]; s[t_] := s[t] = Sqrt[Sum[(t[[k]] - Mean[t])^2, {k, 1, Length[t]}]/Length[t]]
    Table[Count[g[n], p_ /; s[p] < 1], {n, z}]   (*A238616*)
    Table[Count[g[n], p_ /; s[p] <= 1], {n, z}]  (*A238617*)
    Table[Count[g[n], p_ /; s[p] == 1], {n, z}]  (*A238618*)
    Table[Count[g[n], p_ /; s[p] > 1], {n, z}]   (*A238619*)
    Table[Count[g[n], p_ /; s[p] >= 1], {n, z}]  (*A238620*)
    t[n_] := t[n] = N[Table[s[g[n][[k]]], {k, 1, PartitionsP[n]}]] ListPlot[Sort[t[30]]] (*plot of st.dev's of partitions of 30*)
    (* Second program: *)
    b[n_, i_, m_, s_, c_] := b[n, i, m, s, c] = If[n==0, If[s/c-(m/c)^2<1, 1, 0], If[i==1, b[0, 0, m+n, s+n, c+n], Sum[b[n-i*j, i-1, m+i*j, s+i^2*j, c+j], {j, 0, n/i}]]]; a[n_] := b[n, n, 0, 0, 0]; Table[a[n], {n, 1, 55}] (* Jean-François Alcover, Nov 20 2015, after Alois P. Heinz *)
    (* The interest of this 3rd program is just to show how Mathematica's StandardDeviation can be used, with a correction factor, to compute sigma, the population standard deviation. *)
    sigma[t_] := If[Length[t] == 1, 0, StandardDeviation[t]*Sqrt[(Length[t]-1)/ Length[t]]];
    a[n_] := Count[IntegerPartitions[n], p_ /; sigma[p] < 1];
    Array[a, 30] (* Jean-François Alcover, May 28 2021 *)

Formula

a(n) = A000041(n) - A238620(n).

A238658 Number of partitions of n having population standard deviation < 2.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 14, 19, 25, 33, 44, 57, 72, 92, 114, 143, 179, 216, 267, 321, 389, 470, 562, 668, 798, 946, 1100, 1295, 1521, 1759, 2059, 2392, 2742, 3206, 3674, 4172, 4831, 5566, 6265, 7115, 8089, 9152, 10381, 11664, 13131, 14927, 16666, 18565, 20977
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2014

Keywords

Examples

			There are 22 partitions of 8, whose population standard deviations are given by these approximations:  0., 3., 2., 2.35702, 1., 1.69967, 1.73205, 0., 1.24722, 0.942809, 1.22474, 1.2, 0.471405, 1., 0.707107, 0.8, 0.745356, 0., 0.489898, 0.471405, 0.349927, 0, so that a(8) = 19.
		

Crossrefs

Programs

  • Mathematica
    z = 50; g[n_] := g[n] = IntegerPartitions[n]; c[t_] := c[t] = Length[t]; s[t_] := s[t] = Sqrt[Sum[(t[[k]] - Mean[t])^2, {k, 1, c[t]}]/c[t]];
    Table[Count[g[n], p_ /; s[p] < 2], {n, z}]   (* A238658 *)
    Table[Count[g[n], p_ /; s[p] <= 2], {n, z}]  (* A238659 *)
    Table[Count[g[n], p_ /; s[p] == 2], {n, z}]  (* A238660 *)
    Table[Count[g[n], p_ /; s[p] > 2], {n, z}]   (* A238661 *)
    Table[Count[g[n], p_ /; s[p] >= 2], {n, z}]  (* A238662 *)
    t[n_] := t[n] = N[Table[s[g[n][[k]]], {k, 1, PartitionsP[n]}]]
    ListPlot[Sort[t[30]]] (* plot of st deviations of partitions of 30 *)
    (* Second program: *)
    b[n_, i_, m_, s_, c_] := b[n, i, m, s, c] = If[n == 0, If[s/c - (m/c)^2 >= 4, 1, 0], If[i == 1, b[0, 0, m + n, s + n, c + n], Sum[b[n - i*j, i - 1, m + i*j, s + i^2*j, c + j], {j, 0, n/i}]]];
    a[n_] := PartitionsP[n] - b[n, n, 0, 0, 0];
    Array[a, 50] (* Jean-François Alcover, May 27 2021, after Alois P. Heinz *)

Formula

a(n) + A238662(n) = A000041(n).

A238660 Number of partitions of n having population standard deviation = 2.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 1, 1, 3, 0, 5, 0, 7, 4, 2, 0, 19, 3, 2, 9, 20, 0, 38, 0, 22, 33, 7, 12, 84, 0, 8, 52, 90, 0, 127, 0, 87, 103, 22, 0, 304, 9, 74, 131, 153, 0, 214, 139, 390, 192, 59, 0, 1219, 0, 73, 460, 372, 383, 908, 0, 501, 439, 832, 0
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2014

Keywords

Comments

Regarding "standard deviation" see Comments at A238616.

Examples

			There are 22 partitions of 8, whose standard deviations are given by these approximations:  0., 3., 2., 2.35702, 1., 1.69967, 1.73205, 0., 1.24722, 0.942809, 1.22474, 1.2, 0.471405, 1., 0.707107, 0.8, 0.745356, 0., 0.489898, 0.471405, 0.349927, 0, so that a(8) = 1.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, m, s, c) `if`(n=0, `if`(s/c-(m/c)^2=4, 1, 0),
          `if`(i=1, b(0$2, m+n, s+n, c+n), add(b(n-i*j, i-1,
           m+i*j, s+i^2*j, c+j), j=0..n/i)))
        end:
    a:= n-> b(n$2, 0$3):
    seq(a(n), n=1..50);  # Alois P. Heinz, Mar 11 2014
  • Mathematica
    z = 50; g[n_] := g[n] = IntegerPartitions[n]; c[t_] := c[t] = Length[t]; s[t_] := s[t] = Sqrt[Sum[(t[[k]] - Mean[t])^2, {k, 1, c[t]}]/c[t]];
    Table[Count[g[n], p_ /; s[p] < 2], {n, z}]   (*A238658*)
    Table[Count[g[n], p_ /; s[p] <= 2], {n, z}]  (*A238659*)
    Table[Count[g[n], p_ /; s[p] == 2], {n, z}]  (*A238660*)
    Table[Count[g[n], p_ /; s[p] > 2], {n, z}]   (*A238661*)
    Table[Count[g[n], p_ /; s[p] >= 2], {n, z}]  (*A238662*)
    t[n_] := t[n] = N[Table[s[g[n][[k]]], {k, 1, PartitionsP[n]}]]
    ListPlot[Sort[t[30]]] (*plot of st deviations of partitions of 30*)
    (* Second program: *)
    b[n_, i_, m_, s_, c_] := b[n, i, m, s, c] = If[n == 0,
         If[s/c - (m/c)^2 == 4, 1, 0], If[i == 1, b[0, 0, m+n, s+n, c+n],
         Sum[b[n - i*j, i - 1, m + i*j, s + i^2*j, c + j], {j, 0, n/i}]]];
    a[n_] := b[n, n, 0, 0, 0];
    Array[a, 50] (* Jean-François Alcover, Jun 03 2021, after Alois P. Heinz *)

Extensions

a(51)-a(71) from Alois P. Heinz, Mar 11 2014

A238661 Number of partitions of n having standard deviation σ > 2.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 5, 7, 12, 18, 29, 42, 61, 85, 118, 164, 223, 299, 399, 530, 693, 888, 1157, 1488, 1901, 2403, 3044, 3807, 4783, 5935, 7368, 9097, 11197, 13721, 16806, 20441, 24868, 30133, 36494, 43895, 52880, 63424, 75900, 90609, 108088, 128404
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2014

Keywords

Comments

Regarding "standard deviation" see Comments at A238616.

Examples

			There are 22 partitions of 8, whose standard deviations are given by these approximations:  0., 3., 2., 2.35702, 1., 1.69967, 1.73205, 0., 1.24722, 0.942809, 1.22474, 1.2, 0.471405, 1., 0.707107, 0.8, 0.745356, 0., 0.489898, 0.471405, 0.349927, 0, so that a(8) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 50; g[n_] := g[n] = IntegerPartitions[n]; c[t_] := c[t] = Length[t]; s[t_] := s[t] = Sqrt[Sum[(t[[k]] - Mean[t])^2, {k, 1, c[t]}]/c[t]];
    Table[Count[g[n], p_ /; s[p] < 2], {n, z}]   (*A238658*)
    Table[Count[g[n], p_ /; s[p] <= 2], {n, z}]  (*A238659*)
    Table[Count[g[n], p_ /; s[p] == 2], {n, z}]  (*A238660*)
    Table[Count[g[n], p_ /; s[p] > 2], {n, z}]   (*A238661*)
    Table[Count[g[n], p_ /; s[p] >= 2], {n, z}]  (*A238662*)
    t[n_] := t[n] = N[Table[s[g[n][[k]]], {k, 1, PartitionsP[n]}]]
    ListPlot[Sort[t[30]]] (*plot of st deviations of partitions of 30*)

Formula

a(n) + A238659(n) = A000041(n).

A238659 Number of partitions of n having standard deviation σ <= 2.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 14, 20, 25, 35, 44, 59, 72, 93, 115, 146, 179, 221, 267, 328, 393, 472, 562, 687, 801, 948, 1109, 1315, 1521, 1797, 2059, 2414, 2775, 3213, 3686, 4256, 4831, 5574, 6317, 7205, 8089, 9279, 10381, 11751, 13234, 14949, 16666, 18869, 20986
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2014

Keywords

Comments

Regarding "standard deviation" see Comments at A238616.

Examples

			There are 22 partitions of 8, whose standard deviations are given by these approximations:  0., 3., 2., 2.35702, 1., 1.69967, 1.73205, 0., 1.24722, 0.942809, 1.22474, 1.2, 0.471405, 1., 0.707107, 0.8, 0.745356, 0., 0.489898, 0.471405, 0.349927, 0, so that a(8) = 20.
		

Crossrefs

Programs

  • Mathematica
    z = 50; g[n_] := g[n] = IntegerPartitions[n]; c[t_] := c[t] = Length[t]; s[t_] := s[t] = Sqrt[Sum[(t[[k]] - Mean[t])^2, {k, 1, c[t]}]/c[t]];
    Table[Count[g[n], p_ /; s[p] < 2], {n, z}]   (*A238658*)
    Table[Count[g[n], p_ /; s[p] <= 2], {n, z}]  (*A238659*)
    Table[Count[g[n], p_ /; s[p] == 2], {n, z}]  (*A238660*)
    Table[Count[g[n], p_ /; s[p] > 2], {n, z}]   (*A238661*)
    Table[Count[g[n], p_ /; s[p] >= 2], {n, z}]  (*A238662*)
    t[n_] := t[n] = N[Table[s[g[n][[k]]], {k, 1, PartitionsP[n]}]]
    ListPlot[Sort[t[30]]] (*plot of st deviations of partitions of 30*)

Formula

a(n) + A238661(n) = A000041(n).

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
Showing 1-8 of 8 results.