A342262 Numbers divisible both by the product of their nonzero digits (A055471) and by the sum of their digits (A005349).
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 20, 24, 30, 36, 40, 50, 60, 70, 80, 90, 100, 102, 110, 111, 112, 120, 132, 135, 140, 144, 150, 200, 210, 216, 220, 224, 240, 300, 306, 312, 315, 360, 400, 432, 480, 500, 510, 540, 550, 600, 612, 624, 630, 700, 735, 800, 900, 1000, 1002, 1008
Offset: 1
Examples
The product of the nonzero digits of 306 = 3*6 = 18, and 306 divided by 18 = 17. The sum of the digits of 306 = 3 + 0 + 6 = 9, and 306 divided by 9 = 34. Thus 306 is a term.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Mathematica
q[n_] := And @@ Divisible[n, {Times @@ (d = Select[IntegerDigits[n], # > 0 &]), Plus @@ d}]; Select[Range[1000], q] (* Amiram Eldar, Mar 27 2021 *) Select[Range[1200],Mod[#,Times@@(IntegerDigits[#]/.(0->1))]== Mod[#,Total[ IntegerDigits[#]]]==0&] (* Harvey P. Dale, Sep 26 2021 *)
-
PARI
isok(m) = my(d=select(x->(x!=0), digits(m))); !(m % vecprod(d)) && !(m % vecsum(d)); \\ Michel Marcus, Mar 27 2021
Extensions
Example clarified by Harvey P. Dale, Sep 26 2021
Comments