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.
%I A066888 #52 May 22 2025 09:09:55 %S A066888 0,2,1,1,2,2,1,2,3,2,2,3,3,3,3,2,4,3,3,4,4,4,4,4,4,4,4,5,5,6,4,5,3,6, %T A066888 6,7,5,5,6,4,8,5,6,6,8,6,8,5,7,5,11,4,6,9,7,8,9,8,7,7,9,7,8,7,12,5,9, %U A066888 9,11,9,7,7,12,10,10,9,9,9,6,11,10,11,9,12,11,12,9,10,11,12,10,13,9,11,10,12 %N A066888 Number of primes p between triangular numbers T(n) < p <= T(n+1). %C A066888 It is conjectured that for n > 0, a(n) > 0. See also A190661. - _John W. Nicholson_, May 18 2011 %C A066888 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 %H A066888 T. D. Noe, <a href="/A066888/b066888.txt">Table of n, a(n) for n = 0..10000</a> %F A066888 a(n) = pi(n*(n+1)/2) - pi(n*(n-1)/2). %F A066888 a(n) equals the number of occurrences of n+1 in A057062. - _Esko Ranta_, Jul 29 2011 %e A066888 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. %e A066888 Triangle begins %e A066888 1 (0 primes) %e A066888 2 3 (2 primes) %e A066888 4 5 6 (1 prime) %e A066888 7 8 9 10 (1 prime) %e A066888 11 12 13 14 15 (2 primes) %t A066888 Table[PrimePi[(n^2 + n)/2] - PrimePi[(n^2 - n)/2], {n, 96}] (* _Alonso del Arte_, Sep 03 2011 *) %t A066888 PrimePi[#[[2]]]-PrimePi[#[[1]]]&/@Partition[Accumulate[Range[0,100]],2,1] (* _Harvey P. Dale_, Jun 04 2019 *) %o A066888 (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; ) } %o A066888 (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;) } %o A066888 (Python) %o A066888 from sympy import primerange %o A066888 def A066888(n): return sum(1 for p in primerange((n*(n+1)>>1)+1,((n+2)*(n+1)>>1)+1)) # _Chai Wah Wu_, May 22 2025 %Y A066888 Cf. A083382. %Y A066888 Essentially the same as A065382 and A090970. %Y A066888 Cf. A000217, A000040, A014085, A190661. %K A066888 nonn,easy %O A066888 0,2 %A A066888 _N. J. A. Sloane_, Jun 06 2003 %E A066888 More terms from _Vladeta Jovovic_ and _Jason Earls_, Jun 06 2003 %E A066888 Offset corrected by _Daniel Forgues_, Sep 05 2012