A343744 Zuckerman numbers which divided by the product of their digits give integers which are also divisible by the product of their digits, and so on, until result is 1.
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 24, 36, 128, 135, 144, 175, 384, 672, 735, 1296, 1575, 82944, 139968, 1492992, 27869184
Offset: 1
Examples
The integer 1296 is divisible by the product of its digits as 1296/(1*2*9*6) = 12, then 12/(1*2) = 6 and 6/6 = 1; hence, 1296 is a term of this sequence.
Links
- Giovanni Resta, Zuckerman numbers, Numbers Aplenty.
Crossrefs
Programs
-
Mathematica
f[n_] := If[(prod = Times @@ IntegerDigits[n]) > 0 && Divisible[n, prod], n/prod, 0]; Select[Range[10^5], FixedPointList[f, #][[-1]] == 1 &] (* Amiram Eldar, Apr 27 2021 *)
-
PARI
isz(n) = my(p=vecprod(digits(n))); p && !(n % p); \\ A007602 isok(n) = if (n==1, return(1)); my(m=n); until(m==1, if (isz(m), my(nm = m/vecprod(digits(m))); if (nm==m, return (0), m = nm), return(0))); return(1); \\ Michel Marcus, Apr 27 2021
-
Python
def proddigit(n): p = 1 while n > 0: n, p = n//10, p*(n%10) return p n, a = 1, 1 while n > 0: aa, pa = a, proddigit(a) while pa > 1 and aa%pa == 0 and aa > 1: aa = aa//pa pa = proddigit(aa) if aa == 1: print(n,a) n = n+1 a = a+1 # A.H.M. Smeets, Apr 29 2021
Extensions
a(26) from Michel Marcus, Apr 27 2021
Comments