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.

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

This page as a plain text file.
%I A238616 #42 Feb 26 2025 01:53:10
%S A238616 1,2,3,4,6,8,10,12,15,19,23,25,33,41,44,51,58,67,78,84,99,117,124,132,
%T A238616 155,186,202,219,244,268,290,317,344,396,427,449,501,557,597,639,714,
%U A238616 752,824,885,948,1031,1084,1185,1308,1390,1452,1589,1692,1788,1919
%N A238616 Number of partitions of n having standard deviation σ < 1.
%C A238616 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 σ.)
%F A238616 a(n) = A000041(n) - A238620(n).
%e A238616 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.
%p A238616 b:= proc(n, i, m, s, c) `if`(n=0, `if`(s/c-(m/c)^2<1, 1, 0),
%p A238616       `if`(i=1, b(0$2, m+n, s+n, c+n), add(b(n-i*j, i-1,
%p A238616        m+i*j, s+i^2*j, c+j), j=0..n/i)))
%p A238616     end:
%p A238616 a:= n-> b(n$2, 0$3):
%p A238616 seq(a(n), n=1..55);  # _Alois P. Heinz_, Mar 12 2014
%t A238616 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]]
%t A238616 Table[Count[g[n], p_ /; s[p] < 1], {n, z}]   (*A238616*)
%t A238616 Table[Count[g[n], p_ /; s[p] <= 1], {n, z}]  (*A238617*)
%t A238616 Table[Count[g[n], p_ /; s[p] == 1], {n, z}]  (*A238618*)
%t A238616 Table[Count[g[n], p_ /; s[p] > 1], {n, z}]   (*A238619*)
%t A238616 Table[Count[g[n], p_ /; s[p] >= 1], {n, z}]  (*A238620*)
%t A238616 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*)
%t A238616 (* Second program: *)
%t A238616 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_ *)
%t A238616 (* 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. *)
%t A238616 sigma[t_] := If[Length[t] == 1, 0, StandardDeviation[t]*Sqrt[(Length[t]-1)/ Length[t]]];
%t A238616 a[n_] := Count[IntegerPartitions[n], p_ /; sigma[p] < 1];
%t A238616 Array[a, 30] (* _Jean-François Alcover_, May 28 2021 *)
%Y A238616 Cf. A238617-A238620, A238655-A238662.
%Y A238616 Column k=0 of A239223.
%K A238616 nonn,easy
%O A238616 1,2
%A A238616 _Clark Kimberling_, Mar 01 2014