OFFSET
0,2
COMMENTS
It is conjectured that for n > 0, a(n) > 0. See also A190661. - John W. Nicholson, May 18 2011
If the above conjecture is true, then for any k > 1 there is a prime p > k such that p <= (n+1)(n+2)/2, where n = floor(sqrt(2k)+1/2). Ignoring the floor function we can obtain a looser (but nicer) lower bound of p <= 1 + k + 2*sqrt(2k). - Dmitry Kamenetsky, Nov 26 2016
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = pi(n*(n+1)/2) - pi(n*(n-1)/2).
a(n) equals the number of occurrences of n+1 in A057062. - Esko Ranta, Jul 29 2011
EXAMPLE
Write the numbers 1, 2, ... in a triangle with n terms in the n-th row; a(n) = number of primes in n-th row.
Triangle begins
1 (0 primes)
2 3 (2 primes)
4 5 6 (1 prime)
7 8 9 10 (1 prime)
11 12 13 14 15 (2 primes)
MATHEMATICA
Table[PrimePi[(n^2 + n)/2] - PrimePi[(n^2 - n)/2], {n, 96}] (* Alonso del Arte, Sep 03 2011 *)
PrimePi[#[[2]]]-PrimePi[#[[1]]]&/@Partition[Accumulate[Range[0, 100]], 2, 1] (* Harvey P. Dale, Jun 04 2019 *)
PROG
(PARI) { tp(m)=local(r, t); r=1; for(n=1, m, t=0; for(k=r, n+r-1, if(isprime(k), t++)); print1(t", "); r=n+r; ) }
(PARI) {tpf(m)=local(r, t); r=1; for(n=1, m, t=0; for(k=r, n+r-1, if(isprime(k), t++); print1(k" ")); print1(" ("t" prime)"); print(); r=n+r; ) }
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 06 2003
EXTENSIONS
More terms from Vladeta Jovovic and Jason Earls, Jun 06 2003
Offset corrected by Daniel Forgues, Sep 05 2012
STATUS
approved