login
Sums of two or more consecutive semiprimes.
1

%I #9 Jan 29 2024 15:36:13

%S 10,15,19,24,25,29,33,36,39,43,47,48,50,51,54,58,59,60,67,68,69,72,73,

%T 75,77,79,82,83,84,85,91,93,94,95,97,100,101,102,106,107,109,112,115,

%U 116,118,120,122,123,126,127,128,133,134,140,142,143,146,148,151,152

%N Sums of two or more consecutive semiprimes.

%C This is to A050936 as A001358 is to A000040.

%e a(1) = 10 = 4 + 6.

%e a(2) = 15 = 6 + 9.

%e a(3) = 19 = 9 + 10 = 4 + 6 + 9.

%e a(4) = 24 = 10 + 14.

%e a(5) = 25 = 6 + 9 + 10.

%e a(6) = 29 = 14 + 15 = 4 + 6 + 9 + 10.

%e a(7) = 33 = 9 + 10 + 14.

%e a(8) = 36 = 15 + 21.

%e a(9) = 39 = 10 + 14 + 15.

%e a(10) = 43 = 21 + 22.

%p isA001358 := proc(n) if numtheory[bigomega](n) = 2 then true; else false ; fi ; end: A001358 := proc(n) option remember ; local a; if n <= 3 then op(n,[4,6,9]) ; else a := A001358(n-1)+1 ; while not isA001358(a) do a := a+1 ; od ; RETURN(a) ; fi ; end: isA135363 := proc(n) local frst,lst, psum ; for frst from 1 do if A001358(frst) >= n then RETURN(false) ; fi ; for lst from frst+1 do psum := add(A001358(k),k=frst..lst) ; if psum = n then RETURN(true) ; elif psum > n then break ; fi ; od: od: end: for n from 4 to 200 do if isA135363(n) then printf("%d, ",n) ; fi ; od: # _R. J. Mathar_, Dec 11 2007

%t okQ[n_] := With[{SP = Select[Range[n], PrimeOmega[#] == 2 &]}, Select[IntegerPartitions[n, {2, Infinity}, SP], SequencePosition[SP, Reverse@#] != {}&]] != {};

%t Reap[For[k = 10, k < 200, k++, If[okQ[k], Print[k]; Sow[k]]]][[2, 1]] (* _Jean-François Alcover_, Jan 29 2024 *)

%Y Cf. A000040, A001358, A050936.

%K easy,nonn

%O 1,1

%A _Jonathan Vos Post_, Dec 09 2007

%E Corrected and extended by _R. J. Mathar_, Dec 11 2007