OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..100
FORMULA
a(n) = 10^n - A119320(n). - Amiram Eldar, Sep 18 2021
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, 18] (* Robert G. Wilson v, Dec 18 2012 *)
PROG
(PARI) apply( A098450(n)={n=10^n; until(bigomega(n-=1)==2, ); n}, [1..20]) \\ M. F. Hasler, Jan 01 2021
(Python)
from sympy import factorint
def semiprime(n): f = factorint(n); return sum(f[p] for p in f) == 2
def a(n):
an = 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