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 #29 Nov 14 2014 08:18:02
%S 0,0,0,4,0,6,0,4,9,10,0,6,0,14,15,4,0,9,0,10,21,22,0,6,25,26,9,14,0,
%T 15,0,4,33,34,35,9,0,38,39,10,0,21,0,22,15,46,0,6,49,25,51,26,0,9,55,
%U 14,57,58,0,15,0,62,21,4,65,33,0,34,69,35,0,9,0,74
%N Largest semiprime dividing n, or 0 if no semiprime divides n.
%C a(p in primes A000040) = 0; a(k in semiprimes A001358) = k. This is to semiprimes A001358 as A006530 is to primes A000040.
%H Alois P. Heinz, <a href="/A179312/b179312.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = MAX(0, k in A001358 such that k | n).
%e The smallest semiprime is 4, so a(n<4) = 0.
%e a(4) = 4, since 4 = 2^2 is semiprime, and 4 | 4 (i.e. 4/4 = 1).
%e a(5) = 0 because 5 is prime, only 1 and 5 evenly divide 5, no prime (with 1 prime factor) is a semiprimes (with two prime factors, not necessarily distinct).
%e a(6) = 6, since 6 = 2*3 is semiprime, and 6 | ^ (i.e. 6/6 = 1).
%e a(8) = 4, since 4 = 2^2 is semiprime, and 4 | 8 (i.e. 8/4 = 2).
%p a:= proc(n) local l;
%p if n<4 or isprime(n) then 0
%p else l:= sort(ifactors(n)[2], (x, y)-> x[1]>y[1]);
%p l[1][1] *l[`if`(l[1][2]>=2, 1, 2)][1]
%p fi
%p end:
%p seq(a(n), n=1..80); # _Alois P. Heinz_, Jun 23 2012
%t semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Max@ Select[ Divisors@ n, semiPrimeQ] /. {-\[Infinity] -> 0}; Array[f, 55]
%Y Cf. A001358, A006530, A034699, A052126, A052369, A061395
%Y Cf. A088739 (smallest semiprime divisor of n-th composite number)
%K nonn,easy
%O 1,4
%A _Jonathan Vos Post_, Jan 11 2011