login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of partitions of n into two parts (p,q) with p <= q such that p is squarefree and q is semiprime.
2

%I #28 Apr 08 2020 01:40:43

%S 0,0,0,0,1,1,2,1,1,1,3,3,1,1,3,4,3,1,1,3,2,2,2,3,3,3,5,6,3,2,3,4,2,2,

%T 5,7,4,4,6,8,6,4,4,6,5,4,5,7,6,4,4,8,5,5,4,8,6,5,6,8,7,6,7,9,8,6,6,12,

%U 7,8,6,11,5,5,8,9,7,6,9,9,6,5,7,11,6

%N Number of partitions of n into two parts (p,q) with p <= q such that p is squarefree and q is semiprime.

%H Robert Israel, <a href="/A302538/b302538.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%F a(n) = Sum_{i=1..floor((n-1)/2)} mu(i)^2 * [Omega(n-i) = 2], where [] is the Iverson bracket, mu = A008683 and Omega = A001222.

%p N:= 100: # for a(1)..a(N)

%p V:= Vector(N):

%p SF:= select(numtheory:-issqrfree, [$1..N]): nSF:= nops(SF):

%p P:= select(isprime, [2,seq(i,i=3..N/2)]):

%p SP:= sort(select(`<=`,[seq(seq(P[i]*P[j],i=1..j),j=1..nops(P))],N)): nSP:=

%p nops(SP):

%p j0:= 1:

%p for i from 1 to nSF while j0 <= nSP do

%p x:= SF[i];

%p while SP[j0] < x do

%p j0:= j0+1;

%p if j0 > nSP then break fi;

%p if SP[j0] + x > N then j0:= nSP+1; break fi;

%p od;

%p R:= select(`<=`,x +~ SP[j0 .. nSP], N);

%p V[R]:= V[R] +~ 1;

%p od:

%p convert(V,list); # _Robert Israel_, Apr 07 2020

%t Table[Sum[MoebiusMu[i]^2 KroneckerDelta[PrimeOmega[n - i], 2], {i, Floor[n/2]}], {n, 100}]

%Y Cf. A001222, A008683, A303119.

%K nonn,easy,look

%O 1,7

%A _Wesley Ivan Hurt_, Apr 18 2018