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.

Showing 1-2 of 2 results.

A065382 Number of primes between n(n+1)/2 (exclusive) and (n+1)(n+2)/2 (inclusive).

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 05 2001

Keywords

Comments

Inspired by the weaker Legendre conjecture that there should be at least one prime between n^2 and (n+1)^2.

Examples

			a(10) = 2 because between 10*(10+1)/2=55 and (10+1)*(10+2)/2=66 there are 2 primes: 59, 61.
		

Crossrefs

Essentially the same as A066888 and A090970.

Programs

  • Mathematica
    Table[ PrimePi[n(n + 1)/2] - PrimePi[n(n - 1)/2], {n, 2, 96}]
  • Python
    from sympy import primerange
    def A065382(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

Extensions

Definition improved by Robert G. Wilson v, Apr 22 2003

A375752 a(n) is the difference between T=n*(n+1)/2 and the largest prime not exceeding T.

Original entry on oeis.org

0, 1, 3, 2, 2, 5, 5, 2, 2, 5, 5, 2, 2, 7, 5, 2, 4, 9, 11, 2, 2, 5, 7, 8, 2, 5, 5, 2, 2, 5, 5, 4, 2, 11, 5, 2, 2, 7, 9, 2, 16, 5, 7, 2, 12, 5, 5, 2, 16, 5, 5, 2, 2, 9, 13, 16, 2, 11, 7, 2, 2, 5, 11, 2, 4, 5, 5, 4, 8, 5, 7, 2, 8, 7, 9, 2, 2, 23, 11, 2, 12, 17, 11, 12, 2
Offset: 2

Views

Author

Hugo Pfoertner, Aug 26 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[T=n(n+1)/2;T-If[PrimeQ[T],T,NextPrime[T,-1]],{n,2,86}] (* James C. McMahon, Sep 27 2024 *)
  • PARI
    a(n) = my(t=n*(n+1)/2); t - precprime(t)
    
  • Python
    from sympy import prevprime
    def A375752(n): return (t:=n*(n+1)//2) - prevprime(t) # Karl-Heinz Hofmann, Aug 27 2024

Formula

a(n) = A000217(n) - A065384(n). - Michel Marcus, Aug 27 2024
Showing 1-2 of 2 results.