%I #150 May 28 2023 12:54:13
%S 16,55,120,433,378
%N Least number s such that there are 2 different sets of primes { a1, a2, ..., an } and { b1, b2, ..., bn } with the integers in each set having the same sum s, the same sum of squares, etc., up to and including the same sum of (n-1)-st powers.
%C We are to find the least number s such that there is a solution in primes to the system of equations:
%C a1^k + a2^k + ... + an^k = b1^k + b2^k + ... + bn^k, (k = 1, 2, ..., n-1) and {a1, ..., an} != {b1, ..., bn}.
%C a(7), a(8) are respectively <= 2399, 348592.
%H Carlos Rivera, <a href="https://www.primepuzzles.net/problems/prob_067.htm">Problem 67. Multigrade Prime Solutions</a>, The Prime Puzzles & Problems Connection.
%H Chen Shuwen, <a href="http://eslpower.org/TarryPrb.htm">The Prouhet-Tarry-Escott Problem</a>, Equal Sums of Like Powers.
%F a(2) = min({k >= 1 : A117929(k) >= 2}) = Min_{m >= 2} A087747(m) = A087747(2). - _Peter Munn_, May 01 2023
%e a(2) = 16, because 3 + 13 = 16 = 5 + 11 and no lesser sum of 2 distinct primes has this property.
%e a(3) = 55, because 7 + 19 + 29 = 55 = 11 + 13 + 31 and 7^2 + 19^2 + 29^2 = 1251 = 11^2 + 13^2 + 31^2, and no lesser sum of 3 distinct primes has this property.
%e a(4) = 120, because with u = [13, 29, 31, 47] and v = [17, 19, 41, 43], Sum_{i=1..4} u(i) = 120 = Sum_{i=1..4} v(i) and Sum_{i=1..4} u(i)^2 = 4100 = Sum_{i=1..4} v(i)^2 and Sum_{i=1..4} u(i)^3 = 1602000 = Sum_{i=1..4} v(i)^3 and no lesser sum of 4 distinct primes has this property.
%e From _Andrew Howroyd_, Apr 18 2023: (Start)
%e a(5) = 433 with {13, 59, 67, 131, 163} and {23, 31, 103, 109, 167}.
%e a(6) = 378 with {17, 37, 43, 83, 89, 109} and {19, 29, 53, 73, 97, 107}.
%e (End)
%o (PARI) \\ Call with pr=1 to also print solution sets.
%o a(n, pr=0)={
%o forstep(s=3*n, oo, 2, my(P=vector(s,i,primepi(i)), X=primes(P[s]));
%o local(found=0, M=Map(), V=vector(n));
%o my(onSet()=my(key=vector(n-2, j, sum(i=1, n, V[i]^(j+1))), z);
%o if(mapisdefined(M,key,&z), found++; if(pr, print(V, z)), mapput(M,key,V)));
%o my(recurse(r,m,k)=if(k==0, onSet(), for(m=max(k,P[(r-1)\k])+1, min(m, P[r-3*(k-1)]), V[k]=X[m]; self()(r-X[m], m-1, k-1)) ));
%o recurse(s, #X, n);
%o if(found, return(s));
%o )
%o } \\ _Andrew Howroyd_, Apr 18 2023
%Y Cf. A087747, A117929, A239066, A239067, A239068, A323395.
%K nonn,more
%O 2,1
%A _Jean-Marc Rebert_, Apr 15 2023
%E a(5)-a(6) from _Andrew Howroyd_, Apr 18 2023
%E Edited by _Peter Munn_, May 01 2023