A260873 Lexicographically first sequence of positive integers, every nonempty subset of which has a distinct mean.
1, 2, 4, 8, 16, 32, 104, 321, 1010, 3056, 9477, 29437, 91060, 286574, 919633, 2967499, 10043936, 40000426
Offset: 1
Examples
{1} has only 1 nonempty subset, {1}; its mean is 1. {1,2} has 3 nonempty subsets, {1}, {2}, and {1,2}; their means are 1, 2, and 3/2, respectively. {1,2,3} has 7 nonempty subsets, not all of which have distinct means: {2}, {1,3}, and {1,2,3} all have a mean of 2. Therefore, a(3) > 3. {1,2,4} has 7 nonempty subsets, {1}, {2}, {4}, {1,2}, {1,4}, {2,4} and {1,2,4}, all of which have distinct means, so a(3)=4. For the set {1,2,4,5}, the subsets {1,5} and {2,4} have the same mean; for {1,2,4,6}, {4} and {2,6} have the same mean; and for {1,2,4,7}, {4} and {1,7} have the same mean; but all nonempty subsets of {1,2,4,8} are distinct, so a(4)=8. For each k in 9 <= k <= 15, there are at least two subsets of {1,2,4,8,k} having the same mean, but all nonempty subsets of {1,2,4,8,16} have distinct means, so a(5)=16.
Links
- Manfred Scheucher, Sage Script
- Manfred Scheucher, Sage Script#2
Crossrefs
Cf. A259544.
Programs
-
Python
from copy import copy from fractions import Fraction from itertools import chain, combinations def powerset(s): return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) def distinct_means(means, lst, t): newmeans = copy(means) for subset in powerset(lst): sm = Fraction(t+sum(subset), len(subset)+1) if sm in newmeans: return False, means else: newmeans.add(sm) return True, newmeans def aupto(n): largest = 0 alst = [] prevmeans = set() for k in range(n): t = largest + 1 passes, means = distinct_means(prevmeans, alst, t) while not passes: t += 1 passes, means = distinct_means(prevmeans, alst, t) alst.append(t) largest = t prevmeans = means return alst print(aupto(10)) # Michael S. Branicky, Jan 02 2021
Extensions
a(11)-a(13) from Manfred Scheucher, Aug 04 2015
a(14)-a(15) from Manfred Scheucher, Aug 09 2015
a(16)-a(17) from Michael S. Branicky, Aug 05 2023
a(18) from Michael S. Branicky, Aug 22 2023
Comments