OFFSET
0,3
COMMENTS
In categorical data with a sample of size n distributed over at least 1 and at most n distinct categorical types, if a dataset is summarized by an ordered pair of two numbers -- the number of observations of the most frequent type and the sum of squares of the frequencies of all types -- then a(n) gives the number of distinguishable ordered pairs across all possible datasets.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..800
Noah A. Rosenberg and Donna M. Zulman, Measures of care fragmentation: mathematical insights from population genetics, Health Services Research 55 (2020), 318-327.
EXAMPLE
For n=4 the a(4)=5 ordered pairs are (4,16), (3,10), (2,8), (2,6), and (1,4).
MAPLE
b:= proc(n, i) option remember; `if`(n=0 or i=1, {n},
{b(n, i-1)[], map(x-> x+i^2, b(n-i, min(n-i, i)))[]})
end:
a:= n-> add(nops(b(n-i, min(n-i, i))), i=signum(n)..n):
seq(a(n), n=0..60); # Alois P. Heinz, Jun 02 2022
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0 || i == 1, {n},
Union@Flatten@{b[n, i-1], #+i^2& /@ b[n-i, Min[n-i, i]]}];
a[n_] := Sum[Length[b[n-i, Min[n-i, i]]], {i, Sign[n], n}];
Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 05 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Noah A Rosenberg, Jun 02 2022
EXTENSIONS
a(16)-a(51) from Alois P. Heinz, Jun 02 2022
STATUS
approved