A338505 Number of positive integers less than n with the same product of decimal digits as n.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 3, 2, 1, 0, 1, 0, 0, 0, 3, 3, 3, 2, 1, 0, 1, 0, 0, 0, 4, 2, 1, 1, 1, 0, 0, 0, 0, 0, 5, 4, 3, 2, 2, 1, 1, 0, 0, 0, 6, 2, 1, 1, 1, 1, 1, 0, 0, 0, 7, 4, 2, 3, 1, 1, 1, 1, 0, 0, 8
Offset: 1
Examples
a(22) = 2 because A007954(22) = 4 and also A007954(4) = A007954(14) = 4.
Programs
-
Mathematica
Table[Length[Select[Range[n - 1], Times @@ IntegerDigits@# == Times @@ IntegerDigits@n &]], {n, 90}]
-
PARI
a(n)={my(t=vecprod(digits(n))); sum(k=1, n-1, vecprod(digits(k))==t)} \\ Andrew Howroyd, Oct 31 2020
Extensions
Definition clarified by Ilya Gutkovskiy, Apr 14 2022