login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215261 Write down the nonsemiprime numbers 1, 2, 3, 5, 7, 8, 11, 12, 13, 16, 17, ... and insert between two nonsemiprimes the smallest semiprime not yet present in the sequence such that two neighboring integers sum to a nonsemiprime. 2
1, 6, 2, 9, 3, 14, 5, 22, 7, 4, 8, 21, 11, 25, 12, 15, 13, 34, 16, 26, 17, 10, 18, 35, 19, 33, 20, 55, 23, 49, 24, 39, 27, 51, 28, 38, 29, 46, 30, 58, 31, 57, 32, 65, 36, 62, 37, 77, 40, 69, 41, 85, 42, 74, 43, 82, 44, 86, 45, 91, 47, 106, 48, 87, 50, 115, 52 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

This is to semiprimes A001358 as A222307 is to primes A000040.

This is a permutation of the natural numbers A000027 with inverse permutation A211414.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..1000

Index entries for sequences that are permutations of the natural numbers

MAPLE

issp:= n-> not isprime(n) and numtheory[bigomega](n)=2:

sp:= proc(n) option remember; local k; if n=1 then 4 else

       for k from 1+sp(n-1) while not issp(k) do od; k fi end:

nsp:= proc(n) option remember; local k; if n=1 then 1 else

        for k from 1+nsp(n-1) while issp(k) do od; k fi end:

g:= proc() true end:

a:= proc(n) option remember; local k, s;

      if n>1 then a(n-1) fi;

      if irem(n, 2, 'r')=1 then nsp(r+1)

    else for k do s:=sp(k); if g(s) and not issp(nsp(r)+s) and

           not issp(nsp(r+1)+s) then g(s):= false; return s fi od

      fi

    end:

seq(a(n), n=1..80);

MATHEMATICA

issp[n_] := !PrimeQ[n] && PrimeOmega[n] == 2;

sp[n_]  :=  sp[n] = If[n == 1, 4, For[k = 1 + sp[n-1], !issp[k], k++]; k];

nsp[n_] := nsp[n] = If[n == 1, 1, For[k = 1 + nsp[n-1], issp[k], k++]; k];

Clear[g]; g[_] = True;

a[n_] := a[n] = Module[{q, r, k, s}, If[n>1, a[n-1]]; {q, r} = QuotientRemainder[n, 2]; If[r==1, nsp[q+1], For[k = 1, True, k++, s = sp[k]; If[g[s] && !issp[nsp[q] + s] && !issp[nsp[q+1] + s], g[s] = False; Return[s]]]]];

Table[a[n], {n, 1, 80}] (* Jean-Fran├žois Alcover, Mar 24 2017, translated from Maple *)

CROSSREFS

Cf. A001358, A211414, A222307.

Sequence in context: A078756 A019848 A246967 * A132826 A242724 A100123

Adjacent sequences:  A215258 A215259 A215260 * A215262 A215263 A215264

KEYWORD

nonn,easy

AUTHOR

Jonathan Vos Post and Alois P. Heinz, Feb 17 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 3 14:12 EDT 2020. Contains 333197 sequences. (Running on oeis4.)