A064177 Erroneous version of A007666.
1, 5, 6, 353, 72, 1141
Offset: 1
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.
72^5 = 19^5 + 43^5 + 46^5 + 47^5 + 67^5; 94^5 = 21^5 + 23^5 + 37^5 + 79^5 + 84^5; 107^5 = 7^5 + 43^5 + 57^5 + 80^5 + 100^5.
Rows: (1), (3, 4), (3, 4, 5), (30, 120, 272, 315), (19, 43, 46, 47, 67), ...
a(3) = 6 because 3^3 + 4^3 + 5^3 = 6^3.
Table begins: n\k | 1 2 3 4 5 6 7 8 ----+---------------------------------------- 1 | 1 2 3 4 5 6 7 8 2 | 1 5 3 2 4 3 4 4 3 | 1 0 6 7 4 3 5 2 4 | 1 0 422481 353 5 3 9 13 5 | 1 0 ? 144 72 12 23 14 6 | 1 0 ? ? ? ? 1141 251 7 | 1 0 ? ? ? ? 568 102 8 | 1 0 ? ? ? ? ? 1409 T(2,5) = 4 because 4^2 = 1^2 + 1^2 + 1^2 + 2^2 + 3^2 and there is no smaller square that is the sum of 5 positive squares. T(4,3) = 422481 because 422481^4 = 95800^4 + 217519^4 + 414560^4 and there is no smaller 4th power that is the sum of 3 positive 4th powers. T(7,7) = 568 because 568^7 = 127^7 + 258^7 + 266^7 + 413^7 + 430^7 + 439^7 + 525^7 and there is no smaller 7th power that is the sum of 7 positive 7th powers.
/* return 0 instead of 1 for n=1, and oo loop when T(n, k)=0 */ A347773(p, n, s, m)={ /* Check whether s can be written as sum of n positive p-th powers not larger than m^p. If so, return the base a of the largest term a^p. */ s>n*m^p && return; n==1&&return(ispower(s, p, &n)*n); /* if s and m are not given, s>=n and m are arbitrary. */ !s&&for(m=round(sqrtn(n, p)), 9e9, A347773(p, n, m^p, m-1)&&return(m)); for(a=ceil(sqrtn(s\n, p)), min(sqrtn(max(0, s-n+1), p), m), A347773(p, n-1, s-a^p, a)&&return(a)); } /* after M. F. Hasler in A007666 */ /* Just enter "A347773(n, k)" to get T(n, k) */
For n = 2: 625 = 25^2 = 7^2 + 24^2 = 15^2 + 20^2. For n = 3: 157464 = 54^3 = 6^3 + 36^3 + 48^3 = 12^3 + 19^3 + 53^3 = 27^3 + 36^3 + 45^3.
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.
n = 5; SelectFirst[ Range[200], (s = IntegerPartitions[#^n, {4, 4}, Range[1, # - 1]^n]^(1/n); (Select[ s, #[[1]] > #[[2]] > #[[3]] > #[[4]] > 0 &] != {})) &]
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))
Comments