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.

A309883 Numbers k such that A003132(k^2) = A003132(k), where A003132(n) is the sum of the squares of the digits of n.

Original entry on oeis.org

0, 1, 10, 35, 100, 152, 350, 377, 452, 539, 709, 1000, 1299, 1398, 1439, 1519, 1520, 1569, 1591, 1679, 1965, 2599, 2838, 3332, 3500, 3598, 3770, 4520, 4586, 4754, 4854, 5390, 5501, 5835, 5857, 6388, 6595, 6735, 6861, 6951, 7090, 7349, 7887, 8395, 9795, 10000, 10056, 10159, 10389, 11055, 11091, 12990, 12999
Offset: 1

Views

Author

Antonio Roldán, Aug 21 2019

Keywords

Comments

If k is in the sequence, then so are k*10^r, r >= 1.

Examples

			377^2 = 142129, A003132(377) = 3^2 + 7^2 + 7^2 = 107, A003132(142129) = 1^2 + 4^2 + 2^2 + 1^2 + 2^2 + 9^2 = 107.
		

Crossrefs

Programs

  • Magma
    [0] cat [k:k in [1..13000]| &+[c^2: c in Intseq(k)] eq &+[c^2: c in Intseq(k^2)]]; // Marius A. Burtea, Aug 24 2019
  • Maple
    filter:= proc(n) local t;
      add(t^2, t = convert(n,base,10)) = add(t^2, t = convert(n^2,base,10))
    end proc:
    select(filter, [$0..20000]); # Robert Israel, Apr 30 2023
  • Mathematica
    digSum[n_] := Total[IntegerDigits[n]^2]; Select[Range[0, 13000], digSum[#] == digSum[#^2] &] (* Amiram Eldar, Aug 22 2019 *)
  • PARI
    for(i = 0, 30000, if(norml2(digits(i^2)) == norml2(digits(i)), print1(i, ", ")))
    
  • Python
    def A003132(n):
        s = 0
        while n > 0:
            s, n = s+(n%10)**2, n//10
        return s
    n, a = 0, 0
    while n < 50:
        if A003132(a) == A003132(a*a):
            n = n+1
            print(n,a)
        a = a+1 # A.H.M. Smeets, Aug 23 2019