login
a(n) = number of composites c+d such that c is a composite, d is the n-th odd composite, and c < d.
3

%I #12 Jun 08 2026 00:47:52

%S 1,4,7,8,10,13,15,17,20,22,24,24,26,31,33,35,38,40,43,44,46,47,49,52,

%T 53,58,63,63,64,66,66,68,71,73,75,77,79,80,82,84,89,91,91,94,98,99,

%U 102,103,105,109,110,111,114,117,120,122,123,125,128,129,131,131

%N a(n) = number of composites c+d such that c is a composite, d is the n-th odd composite, and c < d.

%C The n-th odd composite is A014076(n+1); the n-th composite is A002808(n).

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

%e a(1) counts this sum: 6+9.

%e a(2) counts these sums: 6+15, 9+15, 10+15, 12+15.

%e a(3) counts these: 4+21, 6+21, 9+21, 12+21, 14+21, 15+21, 18+21.

%p Comps:= remove(isprime, [$4..10^5]):

%p OComps:= select(type,Comps,odd):

%p f:= proc(n) local d,m;

%p d:= OComps[n];

%p m:= ListTools:-BinarySearch(Comps,d);

%p nops(remove(c -> isprime(c+d), Comps[1..m-1]))

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Jun 07 2026

%t z = 400; p = Prime[Range[z]];

%t c = Select[Range[2, z], ! PrimeQ@# &]; (* A002808 *)

%t d = Select[Range[2, z], ! PrimeQ@# && OddQ@# &]; (* A014076 *)

%t f[n_] := Select[c, # < d[[n]] &];

%t g[n_] := d[[n]] + Select[c, # < d[[n]] &];

%t q[n_] := Length[Intersection[p, g[n]]];

%t tq = Table[q[n], {n, 1, 120}] (* A336406 *)

%t tc = Table[Length[f[n]], {n, 1, 120}] (* A336407 *)

%t m = Min[Length[tq], Length[tc]]; Take[tc, m] - Take[tq, m] (* A336408 *)

%Y Cf. A000040, A002808, A014076, A336406, A336407.

%K nonn

%O 1,2

%A _Clark Kimberling_, Jul 20 2020

%E Definition corrected by _Robert Israel_, Jun 07 2026