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.

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