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.

A086005 Semiprimes sandwiched between semiprimes.

Original entry on oeis.org

34, 86, 94, 122, 142, 202, 214, 218, 302, 394, 446, 634, 698, 842, 922, 1042, 1138, 1262, 1346, 1402, 1642, 1762, 1838, 1894, 1942, 1982, 2102, 2182, 2218, 2306, 2362, 2434, 2462, 2518, 2642, 2722, 2734, 3098, 3386, 3602, 3694, 3866, 3902, 3958, 4286, 4414
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 07 2003

Keywords

Comments

These are some of the balanced semiprimes (see A213025). - Alonso del Arte, Jun 04 2012

Examples

			94 = 47*2: 94 - 1 = 3*31 and 94 + 1 = 5*19, therefore 94 is in the sequence.
		

Crossrefs

Programs

  • Haskell
    a086005 n = a086005_list !! (n-1)
    a086005_list = filter
       (\x -> a064911 (x - 1) == 1 && a064911 (x + 1) == 1) a100484_list
    -- Reinhard Zumkeller, Aug 08 2013, Jun 10 2012
    
  • Mathematica
    u[n_]:=Plus@@Last/@FactorInteger[n]==2;lst={};Do[If[u[n],sp=n;If[u[sp-1]&&u[sp+1],AppendTo[lst,sp]]],{n,8!}];lst  (* Vladimir Joseph Stephan Orlovsky, Nov 16 2009 *)
    (* First run program for A109611 to define semiPrimeQ *) Select[Range[4000], Union[{semiPrimeQ[# - 1], semiPrimeQ[#], semiPrimeQ[# + 1]}] == {True} &] (* Alonso del Arte, Jun 03 2012 *)
    Select[Partition[Range@ 4000, 3, 1], Union@ PrimeOmega@ # == {2} &][[All, 2]] (* Michael De Vlieger, Jun 14 2017 *)
  • Python
    from itertools import count, islice
    from sympy import factorint, isprime
    def agen(): # generator of terms
        nxt = 0
        for k in count(2, 2):
            prv, nxt = nxt, sum(factorint(k+1).values())
            if prv == nxt == 2 and isprime(k//2): yield k
    print(list(islice(agen(), 46))) # Michael S. Branicky, Nov 26 2022

Formula

a(n) = 2*A086006(n).
a(n) = A056809(n)+1. - Zak Seidov, Sep 30 2012