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

A382381 Lexicographically earliest sequence of distinct positive integers such that any two subsets with at least two terms have distinct variances.

Original entry on oeis.org

1, 2, 4, 8, 16, 25, 36, 62, 136, 320, 411, 1208, 1295, 4179, 5143, 6380, 31370, 34425, 36094, 213044, 218759, 306722
Offset: 1

Views

Author

Pontus von Brömssen, Mar 23 2025

Keywords

Comments

Numbers k such that A381856(k) = 1.
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.
a(20) > 100000.

Crossrefs

Programs

  • Python
    from fractions import Fraction
    from itertools import chain, combinations, count, islice
    def powerset(s): # skipping empty set
        return chain.from_iterable(combinations(s, r) for r in range(1, len(s)+1))
    def agen(): # generator of terms
        an, alst, vset = 1, [1], set()
        while True:
            yield an
            P = list(powerset(alst))
            Xlst, X2lst = [sum(s) for s in P], [sum(si**2 for si in s) for s in P]
            for k in count(an+1):
                ok, vnew = True, set()
                for i, s in enumerate(P):
                    mu, X2 = Fraction(Xlst[i] + k, len(s)+1), X2lst[i] + k**2
                    v = Fraction(X2, len(s)+1) - mu**2
                    if v in vset or v in vnew:
                        ok = False
                        break
                    else:
                        vnew.add(v)
                if ok:
                    break
            an = k
            vset |= vnew
            alst.append(an)
    print(list(islice(agen(), 13))) # Michael S. Branicky, Mar 31 2025

Extensions

a(20)-a(21) from Michael S. Branicky, Mar 31 2025
a(22) from Michael S. Branicky, Apr 07 2025

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

Original entry on oeis.org

0, 1, 2, 4, 7, 13, 23, 40, 68, 124, 208, 368, 559, 918, 1352, 2017, 2891, 4122, 5506, 7458, 9623, 12620, 16125, 20626, 25401, 31513, 38587, 47244, 56592, 68021, 80503, 95859, 112137, 131986, 153353, 178434, 205627, 236266, 269884, 307167, 346844, 394924, 445797, 501739
Offset: 0

Views

Author

Pontus von Brömssen, Mar 23 2025

Keywords

Comments

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.

Examples

			For n = 4, the following a(4) = 7 variances occur for subsets of {1, 2, 3, 4}:
   variance | corresponding subsets
   ---------+----------------------
       0    | {1}, {2}, {3}, {4}
      1/4   | {1,2}, {2,3}, {3,4}
      2/3   | {1,2,3}, {2,3,4}
       1    | {1,3}, {2,4}
      5/4   | {1,2,3,4}
     14/9   | {1,2,4}, {1,3,4}
      9/4   | {1,4}
		

Crossrefs

Programs

  • Python
    from fractions import Fraction
    def A382383_lst(n):
        s,lst=set(),[0]
        for k in range(n):
            s|={ (x+k,x2+k**2,l+1 ) for (x,x2,l) in s }
            s.add( (k,k**2,1) )
            lst.append(len({ Fraction(x2,l) - Fraction(x,l)**2 for (x,x2,l) in s }))
        return lst # Bert Dobbelaere, Apr 06 2025

Formula

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.

Extensions

a(34)-a(43) from Bert Dobbelaere, Apr 06 2025

A382832 Least k such that there exist two distinct subsets of {0, ..., k-1} with the same sum of m-th powers for 0 <= m <= n.

Original entry on oeis.org

2, 4, 7, 12, 16, 23, 31
Offset: 0

Views

Author

Pontus von Brömssen, Apr 10 2025

Keywords

Comments

Two such sets must have the same size, since the exponent m = 0 is allowed (with the usual convention that 0^0 = 1).
a(n) is the smallest k such that A382833(k,n) < 2^k.

Examples

			  n | a(n) | subsets with the same sums of powers
  --+------+-------------------------------------
  0 |   2  | {0}, {1}
  1 |   4  | {0,3}, {1,2}
  2 |   7  | {0,4,5}, {1,2,6}
  3 |  12  | {0,4,7,11}, {1,2,9,10}
  4 |  16  | {0,5,6,7,13,14}, {1,2,8,9,10,15}
  5 |  23  | {0,5,6,16,17,22}, {1,2,10,12,20,21}
  6 |  31  | {0,5,6,9,16,17,18,22,28,29}, {1,2,8,12,13,14,21,24,25,30}
For n = 3, the two subsets {0,4,7,11} and {1,2,9,10} of {0, ..., 11} have the same sum of m-th powers for 0 <= m <= 3: 0^0+4^0+7^0+11^0 = 1^0+2^0+9^0+10^0 = 4, 0^1+4^1+7^1+11^1 = 1^1+2^1+9^1+10^1 = 22, 0^2+4^2+7^2+11^2 = 1^2+2^2+9^2+10^2 = 186, 0^3+4^3+7^3+11^3 = 1^3+2^3+9^3+10^3 = 1738. There are no such subsets of {0, ..., 10}, so a(3) = 12.
		

Crossrefs

Showing 1-3 of 3 results.