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
