cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A098449 Smallest n-digit semiprime.

This page as a plain text file.
%I A098449 #18 Jun 15 2025 14:38:10
%S A098449 4,10,106,1003,10001,100001,1000001,10000001,100000001,1000000006,
%T A098449 10000000003,100000000007,1000000000007,10000000000015,
%U A098449 100000000000013,1000000000000003,10000000000000003,100000000000000015,1000000000000000007,10000000000000000001
%N A098449 Smallest n-digit semiprime.
%H A098449 Derek Orr, <a href="/A098449/b098449.txt">Table of n, a(n) for n = 1..60</a>
%t A098449 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 *)
%t A098449 Table[Module[{k=0},While[PrimeOmega[10^n+k]!=2,k++];10^n+k],{n,0,20}] (* _Harvey P. Dale_, Jun 15 2025 *)
%o A098449 (PARI)
%o A098449 a(n)=for(k=10^(n-1),10^n-1,if(bigomega(k)==2,return(k)))
%o A098449 vector(50, n, a(n)) \\ _Derek Orr_, Aug 15 2014
%o A098449 (Python)
%o A098449 from sympy import factorint
%o A098449 def semiprime(n): f = factorint(n); return sum(f[p] for p in f) == 2
%o A098449 def a(n):
%o A098449   an = max(1, 10**(n-1))
%o A098449   while not semiprime(an): an += 1
%o A098449   return an
%o A098449 print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Apr 10 2021
%Y A098449 Cf. A098450 (largest n-digit semiprime), A003617 (smallest n-digit prime), A001358 (semiprimes).
%K A098449 base,nonn
%O A098449 1,1
%A A098449 _Rick L. Shepherd_, Sep 07 2004