OFFSET
1,1
LINKS
Derek Orr, Table of n, a(n) for n = 1..60
MATHEMATICA
NextSemiPrime[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sp = n + sgn; While[c < Abs[k], While[ PrimeOmega[sp] != 2, If[sgn < 0, sp--, sp++]]; If[sgn < 0, sp--, sp++]; c++]; sp + If[sgn < 0, 1, -1]]; f[n_] := NextSemiPrime[10^n - 1]; Array[f, 19, 0] (* Robert G. Wilson v, Dec 18 2012 *)
PROG
(PARI)
a(n)=for(k=10^(n-1), 10^n-1, if(bigomega(k)==2, return(k)))
vector(50, n, a(n)) \\ Derek Orr, Aug 15 2014
(Python)
from sympy import factorint
def semiprime(n): f = factorint(n); return sum(f[p] for p in f) == 2
def a(n):
an = max(1, 10**(n-1))
while not semiprime(an): an += 1
return an
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 10 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Rick L. Shepherd, Sep 07 2004
STATUS
approved