OFFSET
1,2
COMMENTS
EXAMPLE
Product of digits of 27 = 2*7 = 14; then 27^2 = 729, product of digits of 729 = 7*2*9 = 81; as 81 divides 729, 27 is a term.
MATHEMATICA
pod[n_] := Times @@ IntegerDigits[n]; Select[Range[120], FreeQ[IntegerDigits[#], 0] && Divisible[pod[#^2], pod[#]] &] (* Amiram Eldar, Feb 19 2022 *)
PROG
(Python)
from math import prod
def pod(n): return prod(map(int, str(n)))
def ok(m): pdm = pod(m); return pdm > 0 and pod(m*m)%pdm == 0
print([m for m in range(124) if ok(m)]) # Michael S. Branicky, Feb 19 2022
(PARI) isok(m) = my(d=digits(m)); vecmin(d) && denominator(vecprod(digits(m^2))/vecprod(d)) == 1; \\ Michel Marcus, Feb 19 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Feb 19 2022
EXTENSIONS
More terms from Amiram Eldar, Feb 19 2022
STATUS
approved