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.

A197125 Numbers such that sum of digits and sum of the square of digits are both a square.

This page as a plain text file.
%I A197125 #10 Nov 21 2013 12:50:20
%S A197125 1,4,9,10,40,90,100,400,900,1000,1111,1177,1224,1242,1339,1393,1422,
%T A197125 1717,1771,1933,2124,2142,2214,2241,2412,2421,3139,3193,3319,3391,
%U A197125 3913,3931,4000,4122,4212,4221,4444,4588,4669,4696,4858,4885,4966,5488,5848,5884
%N A197125 Numbers such that  sum of  digits and sum of the square of digits are both a square.
%C A197125 The sequence contains a majority of numbers with two identical digits at least, but there exists a finite subset A = {1, 4, 9, 10, 40, 90, 156789, 156798, ..., 9876510} of  7!+6 = 5046 numbers with distinct decimal digits. The numbers > 90 of A are all permutations of 1567890.
%H A197125 Harvey P. Dale, <a href="/A197125/b197125.txt">Table of n, a(n) for n = 1..1000</a>
%F A197125 a(n) = {A028839} intersection {A175396}.
%e A197125 597618 is in the sequence because :
%e A197125 5+9+7+6+1+8 = 36 = 6^2 ;
%e A197125 5^2+9^2+7^2+6^2+1^2+8^2 = 256 = 16^2.
%p A197125 for n from 1 to 6000 do:l:=evalf(floor(ilog10(n))+1):n0:=n:s1:=0:s2:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10): n0:=v :s1:=s1+u:s2:=s2+u^2: od:if sqrt(s1)=floor(sqrt(s1)) and sqrt(s2)=floor(sqrt(s2)) then printf(`%d, `, n): else fi:od:
%t A197125 sdQ[n_]:=Module[{idn=IntegerDigits[n]},IntegerQ[Sqrt[Total[idn]]] && IntegerQ[Sqrt[Total[idn^2]]]]; Select[Range[6000],sdQ] (* _Harvey P. Dale_, Oct 25 2011 *)
%Y A197125 Cf. A028839, A175396.
%K A197125 nonn,base
%O A197125 1,2
%A A197125 _Michel Lagneau_, Oct 10 2011