login
A368550
Numbers such that the square root of the sum of each digit cubed is equal to the digital sum of the number.
0
0, 1, 10, 12, 21, 22, 100, 102, 120, 123, 132, 201, 202, 210, 213, 220, 231, 312, 321, 333, 1000, 1002, 1020, 1023, 1032, 1200, 1203, 1224, 1230, 1234, 1242, 1243, 1302, 1320, 1324, 1342, 1422, 1423, 1432, 2001, 2002, 2010, 2013, 2020, 2031, 2100, 2103, 2124, 2130, 2134, 2142, 2143
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
Sequence in context: A035284 A265403 A215940 * A337866 A357045 A320170
KEYWORD
nonn,base
AUTHOR
Thomas Dowson, Dec 29 2023
STATUS
approved