cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A289279 Number of odd composite numbers in ]2*(n-1)^2, 2*n^2[.

Original entry on oeis.org

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

Views

Author

Ralf Steiner, Jul 01 2017

Keywords

Crossrefs

Programs

  • 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 *)
  • PARI
    a(n) = sum(k=2*(n-1)^2, 2*n^2, (k%2) && (k!=1) && !isprime(k)); \\ Michel Marcus, Jul 01 2017

Formula

a(n) = 2n - 1 - A285786(n). - Ralf Steiner, Jul 30 2017