login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A289279
Number of odd composite numbers in ]2*(n-1)^2, 2*n^2[.
0
0, 0, 2, 3, 5, 6, 8, 9, 11, 10, 14, 15, 18, 18, 19, 21, 24, 23, 27, 28, 28, 32, 31, 34, 35, 38, 39, 39, 41, 44, 46, 47, 48, 49, 50, 57, 51, 56, 59, 63, 59, 65, 61, 67, 67, 69, 73, 72, 73, 77, 78, 82, 80, 80, 85, 84, 87, 90, 90, 94, 98, 90, 97, 102, 100
OFFSET
1,3
FORMULA
a(n) = 2n - 1 - A285786(n). - Ralf Steiner, Jul 30 2017
MATHEMATICA
Table[Count[Select[Range[2(n-1)^2, 2 n^2], !PrimeQ[#]&&OddQ[#]&&(#>1) &], _Integer], {n, 1, 100}]
Table[2 n - 1 - (PrimePi[2 n^2] - PrimePi[2 (n - 1)^2]), {n, 1, 100}] (* Ralf Steiner, Jul 30 2017 *)
PROG
(PARI) a(n) = sum(k=2*(n-1)^2, 2*n^2, (k%2) && (k!=1) && !isprime(k)); \\ Michel Marcus, Jul 01 2017
CROSSREFS
Sequence in context: A214980 A098161 A026194 * A102420 A036606 A051837
KEYWORD
nonn
AUTHOR
Ralf Steiner, Jul 01 2017
STATUS
approved