%I #14 May 12 2014 11:59:34
%S 0,1,0,0,3,1,5,2,0,1,3,4,9,1,0,11,0,5,3,0,8,15,2,1,17,10,3,5,9,2,21,1,
%T 0,3,14,11,1,6,5,16,27,3,29,4,0,8,9,15,20,5,1,35,2,17,4,11,3,0,39,5,
%U 12,41,26,9,3,6,21,28,45,14,1,5,8,3,15,11,4,51,1,9,34,5,17,18,27,10,57,10,3,0
%N Difference between largest and smallest prime factor of the n-th composite number.
%C a(n) = 0 iff the n-th composite number is a perfect power.
%C First occurrence of k or 0 if impossible: 2,8,5,12,7,38,0,21,13,26,16,61,0,35,22,40,25,84,0,49,31,156,0,111,0...,.
%H Harvey P. Dale, <a href="/A111426/b111426.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = A046665(A002808(n)). - _R. J. Mathar_, Feb 19 2008
%t Composite[n_] := FixedPoint[n + 1 + PrimePi[ # ] &, n]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]]; f[n_] := Block[{a = First@Transpose@FactorInteger@n}, a[[ -1]] - a[[1]]] (* _Robert G. Wilson v_ *)
%t dif[n_]:=Module[{f=Transpose[FactorInteger[n]][[1]]},If[PrimeQ[n],{},Last[ f]- First[f]]]; Flatten[Table[dif[n],{n,4,200}]] (* _Harvey P. Dale_, May 12 2014 *)
%K nonn
%O 1,5
%A _Giovanni Teofilatto_, Nov 13 2005
%E More terms from _Robert G. Wilson v_, Nov 17 2005
%E Corrected a(19). - _Juri-Stepan Gerasimov_, Jun 16 2009
%E a(19)=3 inserted by _Klaus Brockhaus_, Jun 25 2009
|