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.

A118909 a(1) = 4; a(n) is least semiprime > a(n-1)^2.

This page as a plain text file.
%I A118909 #11 Apr 21 2021 17:04:18
%S A118909 4,21,445,198026,39214296677,1537761063871773242347,
%T A118909 2364709089560047865452947255794201194068433,
%U A118909 5591849078247910476736920566826713466552016538943524658263883555662554776622687075541
%N A118909 a(1) = 4; a(n) is least semiprime > a(n-1)^2.
%C A118909 Semiprime analog of A055496 a(1) = 2; a(n) is smallest prime > 2*a(n-1). See also A059785 a(n+1)=prevprime(a(n)^2), with a(1) = 2. With that, of course, there's always a prime between n and 2n, so a(n) < 2^n. The obverse of this is A118908 a(1) = 4; a(n) is greatest semiprime < a(n-1)^2.
%e A118909 a(8) = a(7)^2 + 52 and there is no smaller k such that a(7)^2 + k is semiprime.
%t A118909 nxt[n_]:=Module[{sp=n^2+1},While[PrimeOmega[sp]!=2,sp++];sp]; NestList[nxt,4,7] (* _Harvey P. Dale_, Oct 22 2012 *)
%o A118909 (Python)
%o A118909 from itertools import accumulate
%o A118909 from sympy.ntheory.factor_ import primeomega
%o A118909 def nextsemiprime(n):
%o A118909   while primeomega(n + 1) != 2: n += 1
%o A118909   return n + 1
%o A118909 def f(anm1, _): return nextsemiprime(anm1**2)
%o A118909 print(list(accumulate([4]*6, f))) # _Michael S. Branicky_, Apr 21 2021
%Y A118909 Cf. A001358, A055496, A076656, A006992, A005384, A005385, A118908-A118913.
%K A118909 easy,nonn
%O A118909 1,1
%A A118909 _Jonathan Vos Post_, May 05 2006