login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Squares that are divisible by both the sum of their digits and the product of their nonzero digits.
0

%I #118 Aug 16 2021 22:08:32

%S 1,4,9,36,100,144,400,900,1296,2304,2916,3600,10000,11664,12100,14400,

%T 22500,32400,40000,41616,82944,90000,121104,122500,129600,152100,

%U 176400,186624,202500,219024,230400,260100,291600,360000,419904,435600,504100

%N Squares that are divisible by both the sum of their digits and the product of their nonzero digits.

%H H. G. Grundman, <a href="http://www.fq.math.ca/Scanned/32-2/grundman.pdf">Sequences of consecutive n-Niven numbers</a>, Fibonacci Quarterly (1994) 32 (2): 174-175.

%H Jean-Marie De Koninck and Florian Luca, <a href="https://doi.org/10.4171/PM/1777">Positive integers divisible by the product of their nonzero digits</a>, Port. Math. 64 (2007) 75-85. (This proof for upper bounds contains an error. See the paper below.)

%H Jean-Marie De Koninck and Florian Luca, <a href="https://doi.org/10.4171/PM/1999">Corrigendum to "Positive integers divisible by the product of their nonzero digits", Portugaliae Math. 64 (2007), 1: 75-85</a>, Port. Math. 74 (2017), 169-170.

%e For the perfect square 144 = 12^2, the sum of its digits is 9, which divides 144, and the product of its nonzero digits is 16, which also divides 144 so 144 is a term of the sequence.

%t Select[Range[720]^2, And @@ Divisible[#, {Plus @@ (d = IntegerDigits[#]), Times @@ Select[d, #1 > 0 &]}] &] (* _Amiram Eldar_, Jul 23 2021 *)

%o (Python)

%o from math import prod

%o def sumd(n): return sum(map(int, str(n)))

%o def nzpd(n): return prod([int(d) for d in str(n) if d != '0'])

%o def ok(sqr): return sqr > 0 and sqr%sumd(sqr) == 0 and sqr%nzpd(sqr) == 0

%o print(list(filter(ok, (i*i for i in range(1001)))))

%o # _Michael S. Branicky_, Jul 23 2021

%Y Intersection of A000290, A005349 and A055471.

%Y Cf. A118547, A342262, A342650.

%K nonn,base

%O 1,2

%A _Michael Gohn_, _Joshua Harrington_, _Sophia Lebiere_, _Hani Samamah_, _Kyla Shappell_, _Wing Hong Tony Wong_, Jul 23 2021