login
Number of positive integers less than n with the same product of decimal digits as n.
1

%I #11 Apr 14 2022 09:28:59

%S 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,

%T 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,

%U 0,6,2,1,1,1,1,1,0,0,0,7,4,2,3,1,1,1,1,0,0,8

%N Number of positive integers less than n with the same product of decimal digits as n.

%F a(n) = |{0 < j < n : A007954(j) = A007954(n)}|.

%e a(22) = 2 because A007954(22) = 4 and also A007954(4) = A007954(14) = 4.

%t Table[Length[Select[Range[n - 1], Times @@ IntegerDigits@# == Times @@ IntegerDigits@n &]], {n, 90}]

%o (PARI) a(n)={my(t=vecprod(digits(n))); sum(k=1, n-1, vecprod(digits(k))==t)} \\ _Andrew Howroyd_, Oct 31 2020

%Y Cf. A007954, A138471, A254524.

%K nonn,base

%O 1,21

%A _Ilya Gutkovskiy_, Oct 31 2020

%E Definition clarified by _Ilya Gutkovskiy_, Apr 14 2022