cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383328 Numbers that have the same set of digits as the sum of the squares of their digits.

Original entry on oeis.org

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

Views

Author

Jean-Marc Rebert, Apr 23 2025

Keywords

Examples

			155 and 1^2 + 5^2 + 5^2 = 51 have the same set of digits {1,5}, so 155 is a term.
		

Crossrefs

Programs

  • Mathematica
    q[k_] := Module[{d = IntegerDigits[k]}, Union[d] == Union[IntegerDigits[Total[d^2]]]]; Select[Range[0, 10000], q] (* Amiram Eldar, 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
  • 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