OFFSET
1,3
COMMENTS
Interestingly 1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789 are all terms.
EXAMPLE
132 is a term since sqrt(1^3 + 3^3 + 2^3) = sqrt(36) = 6 = 1+3+2.
MAPLE
q:= n-> (l-> add(i^3, i=l)=add(i, i=l)^2)(convert(n, base, 10)):
select(q, [$0..2200])[]; # Alois P. Heinz, Dec 30 2023
MATHEMATICA
Select[Range[0, 2200], Total[(d = IntegerDigits[#])^3] == Total[d]^2 &] (* Amiram Eldar, Dec 30 2023 *)
PROG
(Python)
def ok(n): return sum(d:=list(map(int, str(n))))**2==sum(di**3 for di in d)
print([k for k in range(2144) if ok(k)]) # Michael S. Branicky, Dec 30 2023
(PARI) isok(k) = my(d=digits(k)); vecsum(d)^2 == vecsum(apply(x->x^3, d)); \\ Michel Marcus, Dec 30 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Thomas Dowson, Dec 29 2023
STATUS
approved