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.

A098146 First odd semiprime > 10^n.

This page as a plain text file.
%I A098146 #19 Jul 09 2023 09:40:19
%S A098146 9,15,111,1003,10001,100001,1000001,10000001,100000001,1000000013,
%T A098146 10000000003,100000000007,1000000000007,10000000000015,
%U A098146 100000000000013,1000000000000003,10000000000000003,100000000000000015
%N A098146 First odd semiprime > 10^n.
%H A098146 Dario Alpern, <a href="https://www.alpertron.com.ar/ECM.HTM">Factorization using the Elliptic Curve Method.</a>
%e A098146 a(0)=9 because 9=3*3 is the first odd semiprime following 10^0=1.
%e A098146 a(13) = 10000000000015 = 5*2000000000003.
%t A098146 osp[n_]:=Module[{k=1},While[PrimeOmega[n+k]!=2,k=k+2];n+k]; Join[{9}, Table[osp[10^i],{i,20}]] (* _Harvey P. Dale_, Jan 17 2012 *)
%o A098146 (PARI) print1(9,","); for(n=1,10,forstep(i=10^n+1,10^(n+1)-1,2,f=factor(i); ms=matsize(f); if((ms[1]==1&&f[1,2]==2)||(ms[1]==2&&f[1,2]==1&&f[2,2]==1),print1(i,","); break))) /* Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 21 2006 */
%o A098146 (Python)
%o A098146 from sympy import factorint, nextprime
%o A098146 def is_semiprime(n): return sum(e for e in factorint(n).values()) == 2
%o A098146 def next_odd_semiprime(n):
%o A098146     nxt = n + 1 + n%2
%o A098146     while not is_semiprime(nxt): nxt += 2
%o A098146     return nxt
%o A098146 def a(n): return next_odd_semiprime(10**n)
%o A098146 print([a(n) for n in range(20)]) # _Michael S. Branicky_, Sep 15 2021
%Y A098146 Cf. A046315 (odd semiprimes), A098147(n)=a(n)-10^n continuation of this sequence, A003717 (smallest n-digit prime).
%K A098146 nonn
%O A098146 0,1
%A A098146 _Hugo Pfoertner_, Aug 28 2004