OFFSET
1,2
COMMENTS
a(n) <= A066720(n) and a(n+1) >= a(n) + 1
FORMULA
a(n) = min {k >= 1; A338006(k) = n}. - Pontus von Brömssen, Sep 09 2021
EXAMPLE
n | example set
-----+-------------------------------------------------------
1 | {1}
2 | {1, 2}
3 | {1, 2, 3}
4 | {1, 2, 3, 5}
5 | {1, 3, 4, 5, 6}
6 | {1, 3, 4, 5, 6, 7}
7 | {1, 2, 5, 6, 7, 8, 9}
8 | {1, 2, 5, 6, 7, 8, 9, 11}
9 | {1, 2, 5, 6, 7, 8, 9, 11, 13}
10 | {1, 2, 5, 7, 8, 9, 11, 12, 13, 15}
11 | {1, 2, 5, 7, 8, 9, 11, 12, 13, 15, 17}
12 | {1, 2, 5, 7, 8, 9, 11, 12, 13, 15, 17, 19}
13 | {1, 5, 6, 7, 9, 11, 13, 14, 15, 16, 17, 19, 20}
14 | {1, 2, 5, 7, 11, 12, 13, 16, 17, 18, 19, 20, 21, 23}
For n = 4, the set {1,2,3,4} does not have distinct products because 2*2 = 1*4. However, the set {1,2,3,5} does have distinct products because 1*1, 1*2, 1*3, 1*5, 2*2, 2*3, 2*5, 3*3, 3*5, and 5*5 are all distinct.
MATHEMATICA
Table[k=1; While[!Or@@(Length[s=Union[Sort/@Tuples[#, {2}]]]==Length@Union[Times@@@s]&/@Subsets[Range@k, {n}]), k++]; k, {n, 12}] (* Giorgos Kalogeropoulos, Sep 08 2021 *)
PROG
(Python)
from itertools import combinations, combinations_with_replacement
def a(n):
k = n
while True:
for Srest in combinations(range(1, k), n-1):
S = Srest + (k, )
allprods = set()
for i, j in combinations_with_replacement(S, 2):
if i*j in allprods: break
else: allprods.add(i*j)
else: return k
k += 1
print([a(n) for n in range(1, 15)]) # Michael S. Branicky, Sep 08 2021
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Peter Kagey, Sep 03 2021
EXTENSIONS
a(15)-a(20) from Michael S. Branicky, Sep 08 2021
a(21)-a(38) (based on the terms in A338006) from Pontus von Brömssen, Sep 09 2021
STATUS
approved