%I #6 Dec 21 2017 04:37:42
%S 0,0,0,0,0,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%T 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,3,2,3,3,2,
%U 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,3,2,2
%N Additive persistence of double factorials.
%e 10!! = 10*8*6*4*2 = 3840 -> 3+8+4+0 = 15 -> 1+5 = 6 -> persistence = 2.
%p with(numtheory): with(combinat): P:=proc(n) local a,t;t:=0; if n mod 2=0 then a:=2^(n/2)*(n/2)!; else a:=(n+1)!/(2^((n+1)/2)*((n+1)/2)!); fi;
%p while a>9 do t:=t+1; a:=convert(convert(a,base,10),`+`); od; t;
%p end: seq(P(i),i=0..10^2);
%Y Cf. A001147.
%K easy,nonn,base
%O 0,7
%A _Paolo P. Lava_ and _Giorgio Balzarotti_, Jun 19 2007, corrected Jun 22 2007
%E Corrected entries and Maple code by _Paolo P. Lava_, Dec 19 2017
|