(MAGMAMagma) [2*n-(NthPrime(#PrimesUpTo(n^2)+1)-NthPrime(#PrimesUpTo(n^2))): n in [2..100]]; // Vincenzo Librandi, Aug 02 2015
(MAGMAMagma) [2*n-(NthPrime(#PrimesUpTo(n^2)+1)-NthPrime(#PrimesUpTo(n^2))): n in [2..100]]; // Vincenzo Librandi, Aug 02 2015
proposed
approved
editing
proposed
(MAGMA) [2*n-(NthPrime(#PrimesUpTo(n^2)+1)-NthPrime(#PrimesUpTo(n^2))): n in [2..100]]; // Vincenzo Librandi, Aug 02 2015
proposed
editing
editing
proposed
with(numtheory): A162417:=n->2*n-(ithprime(pi(n^2)+1)-ithprime(pi(n^2))): seq(A162417(n), n=2..100); # Wesley Ivan Hurt, Aug 01 2015
Cf. A058043.
proposed
editing
editing
proposed
We find Find max {primes such that p < n^2, n = 2,3,...}, then the gap g(n) between that prime and its successor. This sequence is the sequence of differences {2n - g(n)}.
a(n) = 2*n - A058043(n). - R. J. Mathar, Jul 13 2009
f[n_] := 2 n - Prime[PrimePi[n^2] + 1] + Prime[PrimePi[n^2]]; Table[ f@n, {n, 2, 69}] [From _(* _Robert G. Wilson v_, Aug 17 2009] *)
approved
editing
Edited by _N. J. A. Sloane, _, Jul 05 2009
_Daniel Tisdale (daniel6874(AT)gmail.com), _, Jul 02 2009