[go: up one dir, main page]

login
A345552
Numbers that are the sum of ten cubes in four or more ways.
6
225, 232, 251, 258, 265, 272, 284, 286, 288, 291, 307, 310, 314, 321, 323, 328, 342, 347, 349, 356, 363, 366, 373, 375, 377, 380, 382, 384, 389, 391, 398, 399, 401, 403, 405, 408, 410, 412, 414, 415, 417, 419, 421, 422, 424, 427, 429, 434, 436, 438, 440, 441
OFFSET
1,1
LINKS
EXAMPLE
232 is a term because 232 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 2^3 + 5^3 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3 + 2^3 + 3^3 + 3^3 + 3^3 + 3^3 = 1^3 + 1^3 + 1^3 + 2^3 + 2^3 + 2^3 + 2^3 + 2^3 + 3^3 + 4^3 = 2^3 + 2^3 + 3^3 + 3^3 + 3^3 + 3^3 + 3^3 + 3^3 + 3^3 + 3^3.
PROG
(Python)
from itertools import combinations_with_replacement as cwr
from collections import defaultdict
keep = defaultdict(lambda: 0)
power_terms = [x**3 for x in range(1, 1000)]
for pos in cwr(power_terms, 10):
tot = sum(pos)
keep[tot] += 1
rets = sorted([k for k, v in keep.items() if v >= 4])
for x in range(len(rets)):
print(rets[x])
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved