login
Nearest integer to average of the smallest and largest prime factors of n (0.5 is rounded to 1).
2

%I #2 Feb 11 2014 19:05:32

%S 2,3,2,5,3,7,2,3,4,11,3,13,5,4,2,17,3,19,4,5,7,23,3,5,8,3,5,29,4,31,2,

%T 7,10,6,3,37,11,8,4,41,5,43,7,4,13,47,3,7,4,10,8,53,3,8,5,11,16,59,4,

%U 61,17,5,2,9,7,67,10,13,5,71,3,73,20,4,11,9,8,79,4,3,22,83,5,11,23,16

%N Nearest integer to average of the smallest and largest prime factors of n (0.5 is rounded to 1).

%e The smallest and largest prime factors of 6 are 2 and 3, respectively, the average of which is 2.5, rounding off to 3. Hence a(6) = 3.

%t f[n_] := Module[{p, l}, p = Transpose[FactorInteger[n]][[1]]; l = Length[p]; Ceiling[(p[[1]] + p[[l]])/2]]; Table[f[i], {i, 2, 100}]

%K easy,nonn

%O 2,1

%A _Joseph L. Pe_, Oct 25 2002