OFFSET
1,1
COMMENTS
For n > 1, a(n) = prime(n) iff prime(n) and prime(n+1) are twin primes.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Andrica's Conjecture
FORMULA
a(n) = floor(sqrt(prime(n)*prime(n+1))).
From Miko Labalan, Dec 12 2015: (Start)
(End)
For n >= 2 these formulas are equivalent to sqrt(prime(n)*prime(n+1)) > (prime(n)+prime(n+1))/2 - 1, and thus to A001223(n) <= 2 + 2*sqrt(2*prime(n)). This would be implied by Andrica's conjecture, but is as yet unproven. - Robert Israel, Dec 13 2015
EXAMPLE
a(7) = floor(sqrt(prime(7)*prime(8))) = 17.
MAPLE
seq(floor(sqrt(ithprime(i)*ithprime(i+1))), i=1..100); # Robert Israel, Dec 12 2015
MATHEMATICA
Table[Floor[Sqrt[Prime[n] Prime[n + 1]]], {n, 60}] (* Vincenzo Librandi, Dec 12 2015 *)
Table[Ceiling[(Prime[n] + Prime[n + 1])/2 - 1], {n, 100}] (* Miko Labalan, Dec 14 2015 *)
PROG
(Magma) [Floor(Sqrt(NthPrime(n)*NthPrime(n+1))): n in [1..60]]; // Vincenzo Librandi, Dec 12 2015
(PARI) a(n) = sqrtint(prime(n)*prime(n+1)); \\ Michel Marcus, Dec 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lior Manor, Dec 31 2002
STATUS
approved