login
A118548
Squares which are divisible by the product of their digits.
1
1, 4, 9, 36, 144, 1296, 2916, 11664, 41616, 82944, 186624, 1218816, 2214144, 11614464, 21123216, 21233664, 22127616, 27123264, 49787136, 122943744, 146313216, 171714816, 222129216, 429981696, 812934144, 1316818944
OFFSET
1,2
COMMENTS
Subsequence of squares in A007602. - Michel Marcus, Aug 24 2014
REFERENCES
Elena Deza and Michel Marie Deza, Figurate numbers, World Scientific Publishing (2012), page 423.
LINKS
EXAMPLE
2916 is in the sequence because (1) it is a square, (2) the product of its digits is 2*9*1*6=108 and (3) 2916 is divisible by 108.
MATHEMATICA
sdpdQ[n_]:=Module[{idn=IntegerDigits[n]}, !MemberQ[idn, 0]&&Divisible[ n, Times@@idn]]; Select[Range[40000]^2, sdpdQ] (* Harvey P. Dale, Jul 04 2013 *)
PROG
(Python)
from operator import mul
from functools import reduce
from gmpy2 import t_mod, mpz
A118548 = [n for n in (x**2 for x in range(1, 10**6)) if not (str(n).count('0') or t_mod(n, reduce(mul, (mpz(d) for d in str(n)))))]
# Chai Wah Wu, Aug 23 2014
(PARI) lista(nn) = {for (n=1, nn, sq = n^2; d = digits(sq); p = prod(k=1, #d, d[k]); if (p && !(sq % p), print1(sq, ", ")); ); } \\ Michel Marcus, Aug 24 2014
CROSSREFS
Cf. A007602.
Sequence in context: A372211 A227253 A029997 * A176830 A077211 A073977
KEYWORD
base,nonn
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), May 03 2006
STATUS
approved