OFFSET
2,1
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.
LINKS
Michel Lagneau, Table of n, a(n) for n = 2..20000
EXAMPLE
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.
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}]
PROG
(Magma) [Floor(NthPrime(n)-(n+1)*(Log(n)+Log(Log(n)))+n): n in [2..80]]; // Vincenzo Librandi, Oct 16 2014
(PARI) a(n) = floor(prime(n)-(n+1)*(log(n)+log(log(n))) + n); \\ Michel Marcus, Mar 05 2022
CROSSREFS
KEYWORD
sign
AUTHOR
Michel Lagneau, Oct 16 2014
STATUS
approved