Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Dec 09 2016 03:50:14
%S 1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,0,2,3,4,5,6,7,8,9,0,1,3,4,5,6,7,
%T 8,9,0,1,2,4,5,6,7,8,9,0,1,2,3,5,6,7,8,9,0,1,2,3,4,6,7,8,9,0,1,2,3,4,
%U 5,7,8,9,0,1,2,3,4,5,6,8,9,0,1,2,3,4,5,6,7,9,0,1,2,3,4,5,6,7,8,1,2,3,4,5,6
%N Let s be the sum of the digits of n; a(n) is the product of the digits of s.
%C The sequence is equal to A053837 up to the 488th term.
%H Robert Israel, <a href="/A128244/b128244.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A007954(A007953(n)). - _Michel Marcus_, Dec 09 2016
%e a(345)=2 because 3+4+5=12 and 1*2=2.
%p P:=proc(n) local i,k,w; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; k:=w; w:=1; while k>0 do w:=w*(k-(trunc(k/10)*10)); k:=trunc(k/10); od; print(w); od; end: P(500);
%p # alternative
%p f:= n -> convert(convert(convert(convert(n,base,10),`+`),base,10),`*`):
%p map(f, [$1..100]); # _Robert Israel_, Dec 09 2016
%t sdpd[n_]:=Module[{s=Total[IntegerDigits[n]]},Times@@IntegerDigits[s]]; Array[sdpd, 110] (* _Harvey P. Dale_, Dec 17 2013 *)
%Y Cf. A053837, A007953, A007954.
%K easy,nonn,base
%O 1,2
%A _Paolo P. Lava_ and _Giorgio Balzarotti_, May 03 2007
%E Offset corrected by _Robert Israel_, Dec 09 2016