OFFSET
1,4
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = MAX(0, k in A001358 such that k | n).
EXAMPLE
The smallest semiprime is 4, so a(n<4) = 0.
a(4) = 4, since 4 = 2^2 is semiprime, and 4 | 4 (i.e. 4/4 = 1).
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).
a(6) = 6, since 6 = 2*3 is semiprime, and 6 | ^ (i.e. 6/6 = 1).
a(8) = 4, since 4 = 2^2 is semiprime, and 4 | 8 (i.e. 8/4 = 2).
MAPLE
a:= proc(n) local l;
if n<4 or isprime(n) then 0
else l:= sort(ifactors(n)[2], (x, y)-> x[1]>y[1]);
l[1][1] *l[`if`(l[1][2]>=2, 1, 2)][1]
fi
end:
seq(a(n), n=1..80); # Alois P. Heinz, Jun 23 2012
MATHEMATICA
semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Max@ Select[ Divisors@ n, semiPrimeQ] /. {-\[Infinity] -> 0}; Array[f, 55]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Jan 11 2011
STATUS
approved