A128606 Numbers n such that the product of the squares of digits of n is nonzero and divisible by n.
1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 36, 64, 128, 175, 384, 735, 768, 784, 1296, 1764, 2916, 3675, 5625, 7938, 18432, 28672, 34992, 36864, 39366, 46656, 69984, 82944, 96768, 139968, 165375, 236196, 275625, 297675, 354375, 442368, 497664, 524288, 589824, 746496
Offset: 1
Links
- Max Alekseyev, Table of n, a(n) for n = 1..325
Crossrefs
Cf. A007954.
Programs
-
Maple
P:=proc(n) local i,k,w; for i from 1 by 1 to n do w:=1; k:=i; while k>0 do w:=w*(k-(trunc(k/10)*10))^2; k:=trunc(k/10); od; if w>0 then if trunc(w/i)=w/i then print(i); fi; fi; od; end: P(1000000);
-
Mathematica
fQ[n_] := Block[{d = Times @@ (IntegerDigits[n]^2)}, And[d != 0, Mod[d, n] == 0]]; Select[Range@ 1000000, fQ] (* Michael De Vlieger, Apr 29 2015 *)
-
PARI
for(n=1,10^6,d=digits(n);p=prod(i=1,#d,d[i]);if(p&&!(p^2%n),print1(n,", "))) \\ Derek Orr, Apr 29 2015
Comments