cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A360382 Least integer m whose n-th power can be written as a sum of four distinct positive n-th powers.

Original entry on oeis.org

10, 9, 13, 353, 144
Offset: 1

Views

Author

Zhining Yang, Feb 04 2023

Keywords

Examples

			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.
Terms in this sequence and their representations are:
  10^1 = 1 + 2 + 3 + 4.
  9^2 = 2^2 + 4^2 + 5^2 + 6^2.
  13^3 = 1^3 + 5^3 + 7^3 + 12^3.
  353^4 = 30^4 + 120^4 + 272^4 + 315^4.
  144^5 = 27^5 + 84^5 + 110^5 + 133^5.
		

Crossrefs

Programs

  • Mathematica
    n = 5; SelectFirst[
     Range[200], (s =
        IntegerPartitions[#^n, {4, 4}, Range[1, # - 1]^n]^(1/n); (Select[
          s, #[[1]] > #[[2]] > #[[3]] > #[[4]] > 0 &] != {})) &]
  • Python
    def s(n):
        p=[k**n for k in range(360)]
        for k in range(4,360):
            for d in range(k-1,3,-1):
                if 4*p[d]>p[k]:
                    cc=p[k]-p[d]
                    for c in range(d-1,2,-1):
                        if 3*p[c]>cc:
                            bb=cc-p[c]
                            for b in range(c-1,1,-1):
                               if 2*p[b]>bb:
                                   aa=bb-p[b]
                                   if aa>0 and aa in p:
                                       a=round(aa**(1/n))
                                       return(n,k,[a,b,c,d])
    for n in range(1,6):
        print(s(n))

Formula

a(n) = Minimum(m) such that m^n = a^n + b^n + c^n + d^n and 0 < a < b < c < d < m.