login
Composites k such that composite(k) is odd.
0

%I #12 Jul 08 2022 12:17:18

%S 4,8,12,15,21,26,30,33,35,38,40,44,46,49,55,58,63,66,68,70,77,81,84,

%T 86,88,90,92,94,100,102,106,108,110,112,116,118,121,123,126,129,134,

%U 136,140,142,144,146,150,154,156,158,160,162,165,169,171,176,180,183,185

%N Composites k such that composite(k) is odd.

%e 4 (composite) is a term because composite(4) = 9;

%e 8 (composite) is a term because composite(8) = 15;

%e 12 (composite) is a term because composite(12) = 21.

%p A002808 := proc(n) option remember ; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc:

%p isA002808 := proc(n) n >= 4 and not isprime(n) ; end proc:

%p for i from 1 to 400 do if isA002808(i) then c := A002808(i) ; if type(c,'odd') then printf("%d,",i) ; end if; end if; end do: # _R. J. Mathar_, May 10 2010

%t seq[nmax_] := Module[{m, sq, cc}, For[m = nmax, True, m = m+nmax, sq = Select[cc = Select[Range[m], CompositeQ], If[# <= Length[cc], OddQ[cc[[#]]], False]&]; If[Length[sq] > nmax, Return[Take[sq, nmax]]]]];

%t seq[59] (* _Jean-François Alcover_, Jul 08 2022 *)

%Y Cf. A002808.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Jan 20 2009

%E Entries checked by _R. J. Mathar_, May 10 2010

%E Name and Example section simplified by _Jon E. Schoenfield_, Feb 10 2019