A382381 Lexicographically earliest sequence of distinct positive integers such that any two subsets with at least two terms have distinct variances.
1, 2, 4, 8, 16, 25, 36, 62, 136, 320, 411, 1208, 1295, 4179, 5143, 6380, 31370, 34425, 36094, 213044, 218759, 306722
Offset: 1
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
Comments