login
A383328
Numbers that have the same set of digits as the sum of the squares of their digits.
1
0, 1, 155, 224, 242, 334, 343, 422, 433, 505, 515, 550, 551, 1388, 1788, 1838, 1878, 1883, 1887, 3188, 3334, 3336, 3343, 3363, 3433, 3633, 3818, 3881, 4333, 5005, 5050, 5500, 6333, 7188, 7818, 7881, 8138, 8178, 8183, 8187, 8318, 8381, 8718, 8781, 8813, 8817, 8831
OFFSET
1,3
EXAMPLE
155 and 1^2 + 5^2 + 5^2 = 51 have the same set of digits {1,5}, so 155 is a term.
MATHEMATICA
q[k_] := Module[{d = IntegerDigits[k]}, Union[d] == Union[IntegerDigits[Total[d^2]]]]; Select[Range[0, 10000], q] (* Amiram Eldar, Apr 23 2025 *)
PROG
(Python)
def ok(n): return set(s:=str(n)) == set(str(sum(int(d)**2 for d in s)))
print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Apr 23 2025
(PARI) isok(k) = my(d=digits(k)); Set(d) == Set(digits(sum(i=1, #d, d[i]^2))); \\ Michel Marcus, May 13 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Apr 23 2025
STATUS
approved