OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
2558 is in the sequence because (1)the sum of its digits is 2+5+5+8=20,(2)the product of its digits is 2*5*5*8=400 and 20 is the square root of 400.
MATHEMATICA
sdsqrQ[n_]:=Module[{idn=IntegerDigits[n]}, Total[idn]==Sqrt[Times@@idn]]; Select[Range[0, 18000], sdsqrQ] (* Harvey P. Dale, Oct 20 2012 *)
PROG
(PARI) sudig(i, suOrmul)= { local(nshft, resul) ; nshft = i ; resul = nshft % 10 ; nshft = nshft \ 10 ; while(nshft>0, if(suOrmul==0, resul += nshft % 10, resul *= nshft % 10 ) ; nshft \= 10 ; ) ; return(resul) ; }
{ for(n=0, 15000, summ = sudig(n, 0) ; mull = sudig(n, 1) ; if( summ^2==mull, print1(n, ", ") ) ; ) ; } \\ R. J. Mathar, Apr 21 2006
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), Apr 13 2006
EXTENSIONS
More terms from R. J. Mathar, Apr 21 2006
STATUS
approved