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-5 of 5 results.

A066888 Number of primes p between triangular numbers T(n) < p <= T(n+1).

Original entry on oeis.org

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, 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, 12
Offset: 0

Views

Author

N. J. A. Sloane, Jun 06 2003

Keywords

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

Examples

			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)
		

Crossrefs

Cf. A083382.
Essentially the same as A065382 and A090970.

Programs

  • 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 *)
  • 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;) }
    
  • Python
    from sympy import primerange
    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

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

Extensions

More terms from Vladeta Jovovic and Jason Earls, Jun 06 2003
Offset corrected by Daniel Forgues, Sep 05 2012

A057045 Let R(i,j) be the rectangle with antidiagonals 1; 2,3; 4,5,6; ...; the n-th Lucas number is in antidiagonal a(n).

Original entry on oeis.org

2, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 25, 32, 41, 52, 66, 85, 107, 137, 174, 221, 281, 358, 455, 579, 737, 937, 1192, 1516, 1929, 2454, 3121, 3970, 5050, 6424, 8171, 10394, 13221, 16818, 21393, 27212
Offset: 1

Views

Author

Clark Kimberling, Jul 30 2000

Keywords

Crossrefs

Programs

  • Python
    from gmpy2 import isqrt_rem, lucas
    def A057045(n):
        i, j = isqrt_rem(2*lucas(n-1))
        return int(i + int(4*(j-i) >= 1)) # Chai Wah Wu, Aug 16 2016

Formula

Round(sqrt(2*A000032(n-1))). - Vladeta Jovovic, Jun 14 2003

A057054 Let R(i,j) be the rectangle with antidiagonals 1; 2,3; 4,5,6; ...; n^3 is in antidiagonal a(n).

Original entry on oeis.org

1, 4, 7, 11, 16, 21, 26, 32, 38, 45, 52, 59, 66, 74, 82, 91, 99, 108, 117, 126, 136, 146, 156, 166, 177, 187, 198, 210, 221, 232, 244, 256, 268, 280, 293, 305, 318, 331, 344, 358, 371, 385, 399, 413, 427, 441, 456, 470, 485, 500
Offset: 1

Views

Author

Clark Kimberling, Jul 30 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Round[n Sqrt[2n]],{n,50}] (* Harvey P. Dale, Feb 10 2020 *)

Formula

Round(n*(sqrt(2*n))). - Vladeta Jovovic, Jun 14 2003

A057057 Let R(i,j) be the rectangle with antidiagonals 1; 2,3; 4,5,6; ...; C(n,3) is in antidiagonal a(n).

Original entry on oeis.org

1, 3, 4, 6, 8, 11, 13, 15, 18, 21, 24, 27, 30, 33, 37, 40, 44, 48, 52, 55, 60, 64, 68, 72, 76, 81, 85, 90, 95, 100, 104, 109, 114, 119, 125, 130, 135, 141, 146, 152, 157, 163, 168, 174, 180, 186, 192, 198, 204, 210, 216, 223, 229
Offset: 3

Views

Author

Clark Kimberling, Jul 30 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Round[Sqrt[2*Binomial[n,3]]],{n,3,60}] (* Harvey P. Dale, Nov 16 2021 *)

Formula

Round(sqrt(2*binomial(n, 3))). - Vladeta Jovovic, Jun 14 2003

A123387 Number of triangular numbers <= n-th prime.

Original entry on oeis.org

2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 10 2006

Keywords

Comments

Variant of A057062. - R. J. Mathar, Dec 13 2008

Crossrefs

Programs

  • Mathematica
    f[n_] := Round[Sqrt[2n + 2]]; Table[f[Prime[n]], {n, 90}] (* Ray Chandler, Nov 13 2006 *)
  • Python
    from math import isqrt
    from sympy import prime
    def A123387(n): return isqrt(prime(n)+1<<3)+1>>1 # Chai Wah Wu, Oct 18 2022

Formula

a(n) = A003056(A000040(n)) + 1 = A002024(A000040(n) + 1).
a(n) ~ sqrt(2n log n). - Charles R Greathouse IV, Oct 18 2022

Extensions

Extended by Ray Chandler, Nov 13 2006
Showing 1-5 of 5 results.