%I #7 Aug 05 2021 15:20:40
%S 132,139,158,160,167,174,181,186,193,195,197,200,212,216,219,223,230,
%T 237,238,244,249,251,256,258,263,265,270,272,275,277,282,284,286,288,
%U 289,291,293,296,298,300,301,303,307,308,310,312,314,315,317,319,321,322
%N Numbers that are the sum of eight cubes in two or more ways.
%H Sean A. Irvine, <a href="/A345532/b345532.txt">Table of n, a(n) for n = 1..10000</a>
%e 139 is a term because 139 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 2^3 + 4^3 = 2^3 + 2^3 + 2^3 + 2^3 + 2^3 + 2^3 + 3^3 + 3^3.
%o (Python)
%o from itertools import combinations_with_replacement as cwr
%o from collections import defaultdict
%o keep = defaultdict(lambda: 0)
%o power_terms = [x**3 for x in range(1, 1000)]
%o for pos in cwr(power_terms, 8):
%o tot = sum(pos)
%o keep[tot] += 1
%o rets = sorted([k for k, v in keep.items() if v >= 2])
%o for x in range(len(rets)):
%o print(rets[x])
%Y Cf. A003331, A345489, A345520, A345533, A345541, A345577, A345784.
%K nonn
%O 1,1
%A _David Consiglio, Jr._, Jun 20 2021
|