%I #112 Jun 23 2023 01:58:34
%S 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,10,12,14,16,18,0,3,
%T 6,9,12,15,18,21,24,27,0,4,8,12,16,20,24,28,32,36,0,5,10,15,20,25,30,
%U 35,40,45,0,6,12,18,24,30,36,42,48,54,0,7,14,21,28,35,42,49,56,63,0,8,16,24,32,40,48,56,64,72,0,9,18,27,36,45,54,63,72,81,0,0,0,0,0,0,0,0
%N Product of decimal digits of n.
%C Moebius transform of A093811(n). a(n) = A093811(n) * A008683(n), where operation * denotes Dirichlet convolution, namely b(n) * c(n) = Sum_{d|n} b(d) * c(n/d). Simultaneously holds Dirichlet multiplication: a(n) * A000012(n) = A093811(n). - _Jaroslav Krizek_, Mar 22 2009
%C Apart from the 0's, all terms are in A002473. Further, for all m in A002473 there is some n such that a(n) = m, see A096867. - _Charles R Greathouse IV_, Sep 29 2013
%C a(n) = 0 asymptotically almost surely, namely for all n except for the set of numbers without digit '0'; this set is of density zero, since it is less and less probable to have no '0' as the number of digits of n grows. (See also A054054.) - _M. F. Hasler_, Oct 11 2015
%H N. J. A. Sloane, <a href="/A007954/b007954.txt">Table of n, a(n) for n = 0..10000</a>
%H Rigoberto Flórez, Robinson A. Higuita and Antara Mukherjee, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Mukherjee/mukh2.html">Alternating Sums in the Hosoya Polynomial Triangle</a>, Article 14.9.5 Journal of Integer Sequences, Vol. 17 (2014).
%H Florentin Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/OPNS.pdf">Only Problems, Not Solutions!</a>.
%H <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a>
%F A000035(a(A014261(n))) = 1. - _Reinhard Zumkeller_, Nov 30 2007
%F a(n) = abs(A187844(n)). - _Reinhard Zumkeller_, Mar 14 2011
%F a(n) > 0 if and only if A054054(n) > 0. a(n) = d in {1, ..., 9} if n = (10^k - 1)/9 + (d - 1)*10^m = A002275(k) + (d - 1)*A011557(m) for some k > m >= 0. The statement holds with "if and only if" for d in {1, 2, 3, 5, 7}. For d = 4, 6, 8 or 9, one has a(n) = d if n = (10^k - 1)/9 + (a - 1)*10^m + (b - 1)*10^p with integers k > m > p >= 0 and a, b > 0 such that d = a*b. - _M. F. Hasler_, Oct 11 2015
%F From _Robert Israel_, May 17 2016: (Start)
%F G.f.: Sum_{n >= 0} Product_{j = 0..n} Sum_{k = 1..9} k*x^(k*10^j).
%F G.f. satisfies A(x) = (x + 2*x^2 + ... + 9*x^9)*(1 + A(x^10)). (End)
%F a(n) <= 9^(1 + log_10(n/9)). - _Lucas A. Brown_, Jun 22 2023
%p A007954 := proc(n::integer)
%p if n = 0 then
%p 0;
%p else
%p mul( d,d=convert(n,base,10)) ;
%p end if;
%p end proc: # _R. J. Mathar_, Oct 02 2019
%t Array[Times @@ IntegerDigits@ # &, 108, 0] (* _Robert G. Wilson v_, Mar 15 2011 *)
%o (PARI) A007954(n)= { local(resul = n % 10); n \= 10; while( n > 0, resul *= n %10; n \= 10; ); return(resul); } \\ _R. J. Mathar_, May 23 2006, edited by _M. F. Hasler_, Apr 23 2015
%o (PARI) A007954(n)=prod(i=1,#n=Vecsmall(Str(n)),n[i]-48) \\ (...eval(Vec(...)),n[i]) is about 50% slower; (...digits(n)...) about 6% slower. \\ _M. F. Hasler_, Dec 06 2009
%o (PARI) a(n)=if(n,factorback(digits(n)),0) \\ _Charles R Greathouse IV_, Apr 14 2020
%o (Haskell)
%o a007954 n | n < 10 = n
%o | otherwise = m * a007954 n' where (n', m) = divMod n 10
%o -- _Reinhard Zumkeller_, Oct 26 2012, Mar 14 2011
%o (Magma) [0] cat [&*Intseq(n): n in [1..110]]; // _Vincenzo Librandi_, Jan 03 2020
%o (Scala) (0 to 99).map(_.toString.toCharArray.map(_ - 48).scanRight(1)(_ * _).head) // _Alonso del Arte_, Apr 14 2020
%o (Python)
%o from math import prod
%o def a(n): return prod(map(int, str(n)))
%o print([a(n) for n in range(108)]) # _Michael S. Branicky_, Jan 16 2022
%Y Cf. A031347 (different from A035930), A007953, A007602, A010888, A093811, A008683, A000012, A061076 (partial sums), A230099.
%Y Cf. A051802 (ignoring zeros).
%K nonn,base,easy,nice,hear
%O 0,3
%A R. Muller
%E Error in term 25 corrected, Nov 15 1995