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.

A108197 Number of composite numbers between two successive semiprimes.

Original entry on oeis.org

0, 1, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 1, 0, 4, 1, 1, 2, 1, 0, 1, 2, 2, 2, 2, 3, 1, 0, 0, 2, 1, 0, 0, 7, 2, 2, 2, 0, 1, 0, 0, 4, 2, 0, 4, 0, 0, 1, 0, 6, 1, 0, 1, 3, 1, 6, 0, 2, 1, 1, 4, 4, 0, 0, 1, 0, 2, 2, 0, 0, 1, 0, 0, 1, 3, 5, 1, 7, 1, 2, 0, 3, 2, 1, 1, 4, 2, 6, 1, 1, 2, 2, 0, 1, 0, 0, 1, 2, 2, 3, 1, 1, 2, 0, 1
Offset: 1

Views

Author

Giovanni Teofilatto, Jun 15 2005

Keywords

Comments

This is to A046933 as semiprimes A001358 are to primes A000040. This is to composites A002808 as A088700 is to primes. a(A070552(i)) = 0. - Jonathan Vos Post, Oct 10 2007
a(n) = 0 if A001358(n) is in A070552. - Jonathan Vos Post, Mar 11 2007

Examples

			a(1) = 0 because between 2*2 and 2*3 there is 5 and it is not composite.
a(2) = 1 because between 2*3 and 3*3 there is 8 = 2*2*2;
a(6) = 3 because between 3*5 and 3*7 there are three composite numbers: {16, 18, 20}.
a(10) = 4 because between 2*13 and 3*11 there are four composite numbers: {27, 28, 30, 32}.
a(15) = 4 because there are four composites {40,42,44,45} between semiprime(15)=39 and semiprime(16)=46.
		

Crossrefs

Semiprime analog of A046933.

Programs

  • Maple
    with(numtheory): sp:=proc(n) if bigomega(n)=2 then n else fi end: SP:=[seq(sp(n),n=1..450)]: for j from 1 to nops(SP)-1 do ct:=0: for i from SP[j]+1 to SP[j+1]-1 do if isprime(i)=false then ct:=ct+1 else ct:=ct fi: od: a[j]:=ct: od:seq(a[j],j=1..nops(SP)-1); # Emeric Deutsch, Mar 30 2007
    A001358 := proc(nmin) local a,n ; a :=[] ; n := 1 ; while nops(a) < nmin do if numtheory[bigomega](n) = 2 then a := [op(a),n] ; fi ; n := n+1 ; od: RETURN(a) ; end: A000720 := proc(n) numtheory[pi](n) ; end: A065855 := proc(n) n-A000720(n)-1 ; end: A108197 := proc(nmin) local a,n,a001358 ; a001358 := A001358(nmin+1) ; a := [] ; for n from 1 to nops(a001358)-1 do a := [op(a), A065855(op(n+1,a001358))-A065855(op(n,a001358))-1 ] ; od; RETURN(a) ; end: A108197(100) ; # R. J. Mathar, Oct 23 2007
  • Mathematica
    terms = 105;
    cc = Select[Range[4 terms], CompositeQ] /. c_ /; PrimeOmega[c] == 2 -> 0;
    SequenceReplace[cc, {0, c___ /; FreeQ[{c}, 0]} :> Length[{c}]][[;; terms]] (* Jean-François Alcover, Mar 31 2020 *)

Formula

a(n) = A065855(A001358(n+1)) - A065855(A001358(n)) - 1. - R. J. Mathar, Oct 23 2007
a(n)=A065516(n)-1-A088700(n). - R. J. Mathar, Jul 31 2008

Extensions

Corrected and extended by Ray Chandler, Jul 07 2005
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jul 13 2007
Further edited by N. J. A. Sloane at the suggestion of R. J. Mathar, Jul 01 2008