%I #32 May 13 2024 12:20:01
%S 1,9,1089,1225,25921,372100,3530641,55890576,1682148196
%N Smallest square that can be expressed as Sum_{i=1..n} p(2i-1)^p(2i) where p is a permutation of {1, 2, 3, ..., 2n}.
%C It is unknown whether a(n) exists for all n, but it is expected.
%C a(n) exists for n <= 11. - _Chai Wah Wu_, May 13 2024
%H Bryle Morga et al., <a href="https://mathoverflow.net/questions/470816/does-there-exists-a-sigma-in-s-2n-such-that-sum-n-1n-sigma2n-1">MathOverflow question about this sequence</a>.
%e a(5) = 25921 = 161^2 = 8^1 + 9^3 + 6^5 + 4^7 + 2^10.
%e a(6) = 372100 = 610^2 = 11^1 + 10^3 + 8^4 + 12^5 + 7^6 + 2^9.
%o (Python)
%o import itertools
%o import math
%o def a(n):
%o res = math.inf
%o for p in itertools.permutations([i for i in range(1, 2*n + 1)], n):
%o i = 0
%o s = 0
%o for j in range(1, 2*n + 1):
%o if j not in p:
%o s += p[i]**j
%o i += 1
%o if math.isqrt(s)**2 == s:
%o res = min(res, s)
%o return res
%o (Python)
%o from itertools import combinations, permutations
%o from sympy.ntheory.primetest import is_square
%o def A372652(n):
%o a, m, f = set(range(1,2*n+1)), n*(2*n)**(2*n), [[b**c for c in range(2*n+1)] for b in range(2*n+1)]
%o for b in combinations(a,n):
%o clist = sorted(a-set(b))
%o for d in permutations(range(n)):
%o k = sum(f[b[i]][clist[d[i]]] for i in range(n))
%o if k<m and is_square(k):
%o m = k
%o return m # _Chai Wah Wu_, May 13 2024
%Y Cf. A372653.
%K nonn,more
%O 1,2
%A _Bryle Morga_, May 08 2024
%E a(9) from _Chai Wah Wu_, May 13 2024