A373119 Cardinality of the largest subset of {1,...,n} such that no four distinct elements of this subset multiply to a square.
1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 22, 22, 22, 22, 23, 23, 24, 24, 24, 24, 25, 25, 26, 26, 26
Offset: 1
Keywords
Examples
a(7)=6, because the set {1,2,3,4,5,7} has no four distinct elements multiplying to a square, but {1,2,3,4,5,6,7} has 1*2*3*6 = 6^2.
Links
- P. Erdős, A. Sárközy, and V. T. Sós, On Product Representations of Powers, I, Europ. J. Combinatorics 16 (1995), 567-588.
- P. Pach and M. Vizer, Improved Lower Bounds for Multiplicative Square-Free Sequences, The Electronic Journal of Combinatorics, Volume 30, Issue 4 (2023), P4.31.
- Terence Tao, On product representations of squares, arXiv:2405.11610 [math.NT], May 2024.
Programs
-
Python
from math import isqrt def is_square(n): return isqrt(n) ** 2 == n def valid_subset(A): length = len(A) for i in range(length): for j in range(i + 1, length): for k in range(j + 1, length): for l in range(k + 1, length): if is_square(A[i] * A[j] * A[k] * A[l]): return False return True def largest_subset_size(N): from itertools import combinations for size in reversed(range(1, N + 1)): for subset in combinations(range(1, N + 1), size): if valid_subset(subset): return size for N in range(1, 23): print(largest_subset_size(N))
-
Python
from math import prod from functools import lru_cache from itertools import combinations from sympy.ntheory.primetest import is_square @lru_cache(maxsize=None) def A373119(n): if n==1: return 1 i = A373119(n-1)+1 if sum(1 for p in combinations(range(1,n),3) if is_square(n*prod(p))) > 0: a = [set(p) for p in combinations(range(1,n+1),4) if is_square(prod(p))] for q in combinations(range(1,n),i-1): t = set(q)|{n} if not any(s<=t for s in a): return i else: return i-1 else: return i # Chai Wah Wu, May 30 2024
Extensions
a(22)-a(37) from Michael S. Branicky, May 26 2024
a(38)-a(63) from Martin Ehrenstein, May 27 2024
a(64)-a(69) from Jinyuan Wang, Dec 30 2024
Comments