%I #21 Nov 28 2020 03:56:45
%S 2,2,2,2,2,2,2,3,2,3,2,2,2,3,2,2,2,2,3,2,2,3,2,2,2,3,2,2,2,3,3,2,3,2,
%T 2,2,2,3,3,2,2,2,3,3,2,2,2,2,3,3,2,2,2,3,2,2,3,3,3,2,2,2,3,2,2,3,2,2,
%U 3,3,2,5,2,3,3,2,2,2,2,2,3,2,5,3,3,3,2,2,2,2,3,2,3,2,3,2,2,3,2,2,2,2,3,5,2,2,3,3,3,2,2,2,2,3,5,2,2,3,2,3
%N Third largest prime factor of numbers that are divisible by at least three different primes (A000977).
%C Third largest prime factor of numbers k such that omega(k) = A001221(k) > 2. The 3rd largest prime factor may equal the second largest. This is not identical to third largest distinct prime factor of numbers that are divisible by at least three different primes. Indices n where a(n) equals 2, 3, 5, 7, 11, 13, 17, 19, 23, ... for the first time are 1, 8, 72, 299, 905, 1718, 3302, 6020, 10330, ... the corresponding numbers from A000977 are 30, 90, 350, 1001, 2431, 4199, 7429, 12673, 20677, ...
%e a(1) = 2 because 30 = 2 * 3 * 5 has third largest prime factor 2.
%e a(2) = 2 because 42 = 2 * 3 * 7 has third largest prime factor 2.
%e a(3) = 2 because 60 = 2 * 2 * 3 * 5 has both third and fourth largest prime factor 2.
%e a(8) = 3 because 90 = 2 * 3 * 3 * 5 has both second and third largest prime factor 3.
%p b:= proc(n) option remember; local k;
%p if n=1 then 30
%p else for k from b(n-1)+1 while
%p nops(ifactors(k)[2])<3 do od;
%p k
%p fi
%p end:
%p a:= n-> sort(map(x-> x[1]$x[2], ifactors(b(n))[2]))[-3]:
%p seq(a(n), n=1..120);
%t b[n_] := b[n] = Module[{k}, If[n==1, 30, For[k = b[n-1]+1, PrimeNu[k] < 3, k++]; k]];
%t a[n_] := (Table[#[[1]], {#[[2]]}]& /@ FactorInteger[b[n]] // Flatten // Sort)[[-3]];
%t Array[a, 120] (* _Jean-François Alcover_, Nov 28 2020, after _Alois P. Heinz_ *)
%Y Cf. A000040, A000977, A001221, A002808, A033992, A007774, A000961, A033993, A051270, A087040, A088739, A179312.
%K nonn,easy
%O 1,1
%A _Jonathan Vos Post_, Jan 12 2011
%E Edited by _Alois P. Heinz_, Jan 14 2011