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

A064658 a(n) = ceiling(prime(n) - n*log(n)).

Original entry on oeis.org

2, 2, 2, 2, 3, 3, 4, 3, 4, 6, 5, 8, 8, 7, 7, 9, 11, 9, 12, 12, 10, 11, 11, 13, 17, 17, 15, 14, 12, 11, 21, 21, 22, 20, 25, 22, 24, 25, 25, 26, 27, 25, 30, 27, 26, 23, 31, 38, 37, 34, 33, 34, 31, 36, 37, 38, 39, 36, 37, 36, 33, 38, 46, 45, 42, 41, 50, 51, 55
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Prime[n]-n Log[n]],{n,70}] (* Harvey P. Dale, Dec 07 2018 *)
  • PARI
    { default(realprecision, 100); for (n = 1, 1000, write("b064658.txt", n, " ", ceil(prime(n) - n*log(n))); ) } \\ Harry J. Smith, Jun 25 2009

Formula

a(n) ~ n*log(log(n)) * (1 + 1/log(n) - 1/log(log(n)) - 2/(log(n)*log(log(n)))). - Vaclav Kotesovec, May 23 2020

Extensions

Definition corrected by Harry J. Smith, Jun 24 2009

A064659 a(n) = round(prime(n) - n*log(n)).

Original entry on oeis.org

2, 2, 2, 1, 3, 2, 3, 2, 3, 6, 5, 7, 8, 6, 6, 9, 11, 9, 11, 11, 9, 11, 11, 13, 17, 16, 14, 14, 11, 11, 21, 20, 22, 19, 25, 22, 23, 25, 24, 25, 27, 24, 29, 26, 26, 23, 30, 37, 36, 33, 32, 34, 31, 36, 37, 38, 39, 35, 36, 35, 32, 37, 46, 45, 42, 40, 49, 50, 55
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2001

Keywords

Crossrefs

Programs

  • PARI
    { default(realprecision, 100); for (n = 1, 1000, write("b064659.txt", n, " ", round(prime(n) - n*log(n))); ) } \\ Harry J. Smith, Jun 25 2009

Formula

a(n) ~ n*log(log(n)) * (1 + 1/log(n) - 1/log(log(n)) - 2/(log(n)*log(log(n)))). - Vaclav Kotesovec, May 23 2020

A059112 floor(prime(n) - n*log(n) - n*log(log(n)) + n).

Original entry on oeis.org

4, 4, 4, 5, 4, 5, 4, 5, 7, 6, 8, 8, 6, 6, 8, 10, 7, 9, 9, 6, 8, 7, 8, 12, 11, 8, 7, 5, 4, 13, 12, 13, 10, 15, 12, 12, 13, 12, 13, 13, 10, 15, 11, 10, 7, 13, 20, 18, 15, 13, 14, 10, 14, 15, 15, 15, 12, 12, 10, 7, 11, 19, 17, 13, 11, 20, 20, 24, 20, 18, 18, 20, 20, 20, 18, 18, 20, 18
Offset: 2

Views

Author

Henry Bottomley, Jan 04 2001

Keywords

Examples

			a(10000) = floor[104729 - 92103.403 - 22203.268 + 10000] = floor[422.328] = 422.
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[Prime[n]-n Log[n]-n Log[Log[n]]+n],{n,2,80}] (* Harvey P. Dale, Jul 10 2023 *)
  • PARI
    vector(100,n,floor(prime(n+1) - (n+1)*log(n+1) - (n+1)*log(log(n+1))+n+1)) \\ Derek Orr, Oct 27 2014

A248911 a(n) = floor( prime(n) - (n+1)*log(n) ).

Original entry on oeis.org

2, 0, 0, 0, 1, 0, 1, 0, 1, 3, 2, 4, 5, 3, 3, 5, 8, 6, 8, 8, 6, 7, 7, 9, 13, 13, 10, 10, 7, 7, 17, 16, 18, 15, 21, 18, 19, 21, 20, 21, 23, 20, 25, 22, 21, 19, 26, 33, 32, 29, 28, 29, 26, 31, 32, 33, 34, 31, 32, 31, 28, 32, 41, 40, 37, 36, 45, 45, 50, 47, 46, 46
Offset: 1

Views

Author

Michel Lagneau, Oct 16 2014

Keywords

Comments

The function log gives the natural logarithm (to base e).
See A059111 for the sequence a(n) = floor(prime(n)-n*log(n)).

Examples

			a(8) = 0 because floor(prime(8)-(8+1)*log(8)) = floor(19 -9*2.07944154...) = floor(.28502612...) = 0.
		

Crossrefs

Programs

  • Magma
    [Floor(NthPrime(n)-(n+1)*Log(n)): n in [1..80]]; // Vincenzo Librandi, Oct 16 2014
  • Maple
    with(numtheory):
    for n from 1 to 200 do:
      p:=floor(evalf(ithprime(n)-(n+1)*ln(n))): printf(`%d, `,p):
    od:
  • Mathematica
    Table[Floor[Prime[n]-(n+1)Log[n]], {n, 100}]

A204325 Residual of an asymptotic formula for the n-th prime: a(n) = floor(prime(n)-n*log(n) + n - n*log(log(n)) - (n/log(n))*(log(log(n)) - 2) + (log(log(n)) - 6)*n*log(log(n))/(2*log(n)^2)).

Original entry on oeis.org

16, 8, 7, 7, 6, 7, 5, 6, 8, 6, 9, 9, 7, 6, 8, 10, 8, 9, 9, 6, 8, 7, 8, 11, 11, 8, 7, 4, 3, 12, 11, 12, 9, 14, 10, 11, 12, 11, 11, 12, 9, 13, 10, 8, 5, 11, 18, 16, 12, 11, 11, 8, 12, 12, 12, 13, 9, 9, 7, 4, 8, 16, 14, 10, 8, 16, 16, 20, 16
Offset: 2

Views

Author

Keywords

Comments

prime(n) ~ n*log(n) + n - n*log(log(n)) - (n/log(n))*(log(log(n)) - 2) + (log(log(n)) - 6)*n*log(log(n))/(2*log(n)^2).
The first negative term is a(214) = -2. - Jason Yuen, Feb 17 2025

References

  • M. Cipolla, La determinazione asintotica dell'n-mo numero primo, Rend. d. R. Acc. di sc. fis. e mat. di Napoli, s. 3, VIII (1902), pp. 132-166.

Crossrefs

Programs

  • Mathematica
    Table[Floor[Prime[n]-n*Log[n]+n-n*Log[Log[n]]- (n/Log[n]) (Log[Log[n]]-2)+(Log[Log[n]]-6)*n*Log[Log[n]]/(2*Log[n]^2)],{n,2,100}]
  • PARI
    a(n) = floor(prime(n)-n*log(n) + n - n*log(log(n)) - (n/log(n))*(log(log(n)) - 2) + (log(log(n)) - 6)*n*log(log(n))/(2*log(n)^2)); \\ Michel Marcus, Feb 22 2025

A204594 Nearest integer to n*log(n) + n*log(log(n)) - n + n/log(n)*(log(log(n))-2) - n*log(log(n))*(log(log(n))-6)/(2 log(n)^2), an asymptotic expression for prime(n).

Original entry on oeis.org

-13, -4, 0, 3, 6, 10, 13, 17, 20, 24, 28, 32, 36, 40, 44, 49, 53, 57, 62, 66, 71, 76, 80, 85, 90, 95, 100, 105, 109, 115, 120, 125, 130, 135, 140, 145, 151, 156, 161, 167, 172, 177, 183, 188, 194, 199, 205, 210, 216, 222, 227, 233, 239, 244, 250, 256, 262
Offset: 2

Views

Author

M. F. Hasler, Feb 07 2012

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Round[n Log[n] + n Log[Log[n]] - n + n/Log[n](Log[Log[n]] - 2) - n Log[Log[n]](Log[Log[n]] - 6)/(2 Log[n]^2)], {n, 2, 58}] (* Alonso del Arte, Feb 07 2012 *)
  • PARI
    A204594(n)=round(n*log(n)+n*log(log(n))-n+n/log(n)*(log(log(n))-2)-n*log(log(n))/2/log(n)^2*(log(log(n))-6))

A248912 a(n) = floor(prime(n) - (n+1)*(log(n) + log(log(n))) + n) for n > 1.

Original entry on oeis.org

4, 3, 2, 3, 2, 3, 1, 2, 4, 2, 4, 4, 2, 2, 4, 6, 3, 5, 5, 2, 3, 3, 4, 7, 7, 4, 3, 0, -1, 8, 7, 8, 5, 10, 7, 7, 8, 7, 8, 8, 5, 10, 6, 5, 1, 8, 14, 13, 9, 8, 8, 5, 9, 9, 10, 10, 6, 7, 5, 1, 5, 13, 12, 8, 6, 14, 14, 18, 14, 12, 12, 14, 14, 14, 12, 12, 14, 12, 14
Offset: 2

Views

Author

Michel Lagneau, Oct 16 2014

Keywords

Comments

The function log gives the natural logarithm (to base e).
a(30) = -1 is the unique negative value.
See A059112 for floor( prime(n) - n*log(n) - n*log(log(n)) + n ) where prime(n) is the n-th prime.

Examples

			a(8) = 1 because floor(prime(8)-(8+1)*(log(8)+log(log(8))) + 8) = floor(19-9*(2.0794415...+0.7320993...) + 8) = floor(1.6961318...) = 1.
		

Crossrefs

Programs

  • Magma
    [Floor(NthPrime(n)-(n+1)*(Log(n)+Log(Log(n)))+n): n in [2..80]]; // Vincenzo Librandi, Oct 16 2014
    
  • Maple
    with(numtheory):for n from 1 to 200 do:p:=floor(evalf(ithprime(n)-(n+1)*ln(n)- (n+1)*ln(ln(n)) + n)): printf(`%d, `,p):od:
  • Mathematica
    Table[Floor[Prime[n]-(n+1)*(Log[n]+Log[Log[n]])+n], {n,2, 100}]
  • PARI
    a(n) = floor(prime(n)-(n+1)*(log(n)+log(log(n))) + n); \\ Michel Marcus, Mar 05 2022
Showing 1-7 of 7 results.