login
Number of composite numbers between two successive semiprimes.
2

%I #17 Mar 31 2020 10:53:35

%S 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,

%T 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,

%U 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

%N Number of composite numbers between two successive semiprimes.

%C 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

%C a(n) = 0 if A001358(n) is in A070552. - _Jonathan Vos Post_, Mar 11 2007

%F a(n) = A065855(A001358(n+1)) - A065855(A001358(n)) - 1. - _R. J. Mathar_, Oct 23 2007

%F a(n)=A065516(n)-1-A088700(n). - _R. J. Mathar_, Jul 31 2008

%e a(1) = 0 because between 2*2 and 2*3 there is 5 and it is not composite.

%e a(2) = 1 because between 2*3 and 3*3 there is 8 = 2*2*2;

%e a(6) = 3 because between 3*5 and 3*7 there are three composite numbers: {16, 18, 20}.

%e a(10) = 4 because between 2*13 and 3*11 there are four composite numbers: {27, 28, 30, 32}.

%e a(15) = 4 because there are four composites {40,42,44,45} between semiprime(15)=39 and semiprime(16)=46.

%p 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

%p 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

%t terms = 105;

%t cc = Select[Range[4 terms], CompositeQ] /. c_ /; PrimeOmega[c] == 2 -> 0;

%t SequenceReplace[cc, {0, c___ /; FreeQ[{c}, 0]} :> Length[{c}]][[;; terms]] (* _Jean-François Alcover_, Mar 31 2020 *)

%Y Semiprime analog of A046933.

%Y Cf. A001358, A002808, A046933, A065855, A070552, A088700.

%K easy,nonn

%O 1,6

%A _Giovanni Teofilatto_, Jun 15 2005

%E Corrected and extended by _Ray Chandler_, Jul 07 2005

%E Edited by _N. J. A. Sloane_ at the suggestion of _Andrew S. Plewe_, Jul 13 2007

%E Further edited by _N. J. A. Sloane_ at the suggestion of _R. J. Mathar_, Jul 01 2008