%I #22 Mar 04 2023 15:27:54
%S 10,9,13,353,144
%N Least integer m whose n-th power can be written as a sum of four distinct positive n-th powers.
%F a(n) = Minimum(m) such that m^n = a^n + b^n + c^n + d^n and 0 < a < b < c < d < m.
%e a(3) = 13 because 13^3 = 1^3 + 5^3 + 7^3 + 12^3 and no smaller cube may be written as the sum of 4 positive distinct cubes.
%e Terms in this sequence and their representations are:
%e 10^1 = 1 + 2 + 3 + 4.
%e 9^2 = 2^2 + 4^2 + 5^2 + 6^2.
%e 13^3 = 1^3 + 5^3 + 7^3 + 12^3.
%e 353^4 = 30^4 + 120^4 + 272^4 + 315^4.
%e 144^5 = 27^5 + 84^5 + 110^5 + 133^5.
%t n = 5; SelectFirst[
%t Range[200], (s =
%t IntegerPartitions[#^n, {4, 4}, Range[1, # - 1]^n]^(1/n); (Select[
%t s, #[[1]] > #[[2]] > #[[3]] > #[[4]] > 0 &] != {})) &]
%o (Python)
%o def s(n):
%o p=[k**n for k in range(360)]
%o for k in range(4,360):
%o for d in range(k-1,3,-1):
%o if 4*p[d]>p[k]:
%o cc=p[k]-p[d]
%o for c in range(d-1,2,-1):
%o if 3*p[c]>cc:
%o bb=cc-p[c]
%o for b in range(c-1,1,-1):
%o if 2*p[b]>bb:
%o aa=bb-p[b]
%o if aa>0 and aa in p:
%o a=round(aa**(1/n))
%o return(n,k,[a,b,c,d])
%o for n in range(1,6):
%o print(s(n))
%Y Cf. A007666, A039664, A003294, A134341.
%K nonn,more
%O 1,1
%A _Zhining Yang_, Feb 04 2023
|