OFFSET
1,2
LINKS
H. G. Grundman, Sequences of consecutive n-Niven numbers, Fibonacci Quarterly (1994) 32 (2): 174-175.
Jean-Marie De Koninck and Florian Luca, Positive integers divisible by the product of their nonzero digits, Port. Math. 64 (2007) 75-85. (This proof for upper bounds contains an error. See the paper below.)
Jean-Marie De Koninck and Florian Luca, Corrigendum to "Positive integers divisible by the product of their nonzero digits", Portugaliae Math. 64 (2007), 1: 75-85, Port. Math. 74 (2017), 169-170.
EXAMPLE
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.
MATHEMATICA
Select[Range[720]^2, And @@ Divisible[#, {Plus @@ (d = IntegerDigits[#]), Times @@ Select[d, #1 > 0 &]}] &] (* Amiram Eldar, Jul 23 2021 *)
PROG
(Python)
from math import prod
def sumd(n): return sum(map(int, str(n)))
def nzpd(n): return prod([int(d) for d in str(n) if d != '0'])
def ok(sqr): return sqr > 0 and sqr%sumd(sqr) == 0 and sqr%nzpd(sqr) == 0
print(list(filter(ok, (i*i for i in range(1001)))))
# Michael S. Branicky, Jul 23 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michael Gohn, Joshua Harrington, Sophia Lebiere, Hani Samamah, Kyla Shappell, Wing Hong Tony Wong, Jul 23 2021
STATUS
approved