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.

A382383 Number of distinct variances of nonempty subsets of {1, ..., n}.

This page as a plain text file.
%I A382383 #23 Apr 06 2025 06:37:33
%S A382383 0,1,2,4,7,13,23,40,68,124,208,368,559,918,1352,2017,2891,4122,5506,
%T A382383 7458,9623,12620,16125,20626,25401,31513,38587,47244,56592,68021,
%U A382383 80503,95859,112137,131986,153353,178434,205627,236266,269884,307167,346844,394924,445797,501739
%N A382383 Number of distinct variances of nonempty subsets of {1, ..., n}.
%C A382383 The variance of a nonempty set X is (Sum_{x in X} (x-m)^2)/|X|, where m is the average of X and |X| is the size of X.
%F A382383 a(n) <= 1 + Sum_{k=1..n-1} A005418(k). The smallest positive n for which strict inequality holds is n = 7. This is because there exist subsets of {1, ..., 7} which are not translates or reflections of each other, but nonetheless have the same variance. For example, {1,5}, {1,3,4,5,7}, and {1,2,3,4,5,6,7} all have variance 4, and {1,2,6} and {1,2,3,5,6,7} both have variance 14/3.
%e A382383 For n = 4, the following a(4) = 7 variances occur for subsets of {1, 2, 3, 4}:
%e A382383    variance | corresponding subsets
%e A382383    ---------+----------------------
%e A382383        0    | {1}, {2}, {3}, {4}
%e A382383       1/4   | {1,2}, {2,3}, {3,4}
%e A382383       2/3   | {1,2,3}, {2,3,4}
%e A382383        1    | {1,3}, {2,4}
%e A382383       5/4   | {1,2,3,4}
%e A382383      14/9   | {1,2,4}, {1,3,4}
%e A382383       9/4   | {1,4}
%o A382383 (Python)
%o A382383 from fractions import Fraction
%o A382383 def A382383_lst(n):
%o A382383     s,lst=set(),[0]
%o A382383     for k in range(n):
%o A382383         s|={ (x+k,x2+k**2,l+1 ) for (x,x2,l) in s }
%o A382383         s.add( (k,k**2,1) )
%o A382383         lst.append(len({ Fraction(x2,l) - Fraction(x,l)**2 for (x,x2,l) in s }))
%o A382383     return lst # _Bert Dobbelaere_, Apr 06 2025
%Y A382383 Cf. A005418, A135342, A208531, A382381, A382382.
%K A382383 nonn
%O A382383 0,3
%A A382383 _Pontus von Brömssen_, Mar 23 2025
%E A382383 a(34)-a(43) from _Bert Dobbelaere_, Apr 06 2025