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.

A194189 Number of primes between the n-th triangular number and the n-th square.

Original entry on oeis.org

0, 0, 1, 2, 3, 3, 6, 7, 8, 9, 12, 13, 15, 17, 18, 22, 25, 27, 30, 32, 35, 38, 41, 43, 48, 52, 55, 58, 62, 64, 68, 73, 79, 83, 86, 89, 93, 97, 103, 110, 114, 120, 123, 129, 132, 139, 141, 149, 157, 162, 162, 173, 183, 186, 192, 195, 198, 207, 213, 222, 229
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 01 2011

Keywords

Comments

a(n) = A038107(n) - A111208(n).

Examples

			a(10) = #{59,61,67,71,73,79,83,89,97} = 9;
a(11) = #{67,71,73,79,83,89,97,101,103,107,109,113} = 12;
a(12) = #{79,83,89,97,101,103,107,109,113,127,131,137,139} = 13.
		

Crossrefs

Programs

  • Haskell
    a194189 n = sum $ map a010051 [n*(n+1) `div` 2 + 1 .. n^2 - 1]
  • Mathematica
    Table[PrimePi[n^2] - PrimePi[n*(n+1)/2], {n, 100}] (* T. D. Noe, Nov 01 2011 *)
    PrimePi[#[[2]]]-PrimePi[#[[1]]]&/@Module[{nn=70},Thread[{Accumulate[ Range[ nn]],Range[nn]^2}]] (* Harvey P. Dale, Aug 21 2019 *)