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.

A175396 Numbers whose sum of squares of digits is a square.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 34, 40, 43, 50, 60, 68, 70, 80, 86, 90, 100, 122, 148, 184, 200, 212, 221, 236, 244, 263, 269, 296, 300, 304, 326, 340, 362, 366, 400, 403, 418, 424, 430, 442, 447, 474, 481, 488, 500, 600, 608, 623, 629, 632, 636, 663
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2010

Keywords

Comments

Previous name: Numbers n such that Sum_{i=1..r, x(i)^2} is a perfect square, where x(i) = digits of n. r=1+floor(log_10 n).

Examples

			34 is a term: 3^2 + 4^2 = 25 = 5^2.
122 is a term: 1^2 + 2^2 + 2^2 = 9 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 666], IntegerQ[Sqrt[Plus @@ (IntegerDigits[#]^2)]] &] (* Ivan Neretin, Aug 03 2015 *)
  • PARI
    isok(n) = {my(digs = digits(n)); issquare(sum(i=1, #digs, digs[i]^2))} \\ Michel Marcus, Jun 02 2013
    
  • Python
    from math import isqrt
    def ok(n): s = sum(int(i)**2 for i in str(n)); return isqrt(s)**2 == s
    print(*[k for k in range(664) if ok(k)], sep = ', ')  # Ya-Ping Lu, Jul 07 2025

Extensions

Corrected and extended by Neven Juric, Jul 12 2010
Simpler definition by Michel Marcus, Jun 02 2013