# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a162417 Showing 1-1 of 1 %I A162417 #13 Sep 08 2022 08:45:46 %S A162417 2,2,4,4,6,8,10,14,16,8,14,20,24,26,26,24,22,30,36,38,36,28,42,38,48, %T A162417 48,42,44,40,48,54,62,58,64,66,68,68,66,76,58,66,72,72,80,76,88,84,86, %U A162417 74,86,96,90,100,96,96,92,106,96,106,114,110,104,122,120,124,124,120,114 %N A162417 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)}. %C A162417 The unproved conjecture that 2n - g(n) > 0 would imply Legendre's conjecture, since the next prime after max {p < n^2} will always occur before (n+1)^2. %F A162417 a(n) = 2*n - A058043(n). - _R. J. Mathar_, Jul 13 2009 %p A162417 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 %t A162417 Table[2i - (Prime[PrimePi[i^2]+1]-Prime[PrimePi[i^2]]),{i,2,1000}] %t A162417 f[n_] := 2 n - Prime[PrimePi[n^2] + 1] + Prime[PrimePi[n^2]]; Table[ f@n, {n, 2, 69}] (* _Robert G. Wilson v_, Aug 17 2009 *) %o A162417 (Magma) [2*n-(NthPrime(#PrimesUpTo(n^2)+1)-NthPrime(#PrimesUpTo(n^2))): n in [2..100]]; // _Vincenzo Librandi_, Aug 02 2015 %Y A162417 Cf. A058043. %K A162417 nonn %O A162417 2,1 %A A162417 _Daniel Tisdale_, Jul 02 2009 %E A162417 Edited by _N. J. A. Sloane_, Jul 05 2009 %E A162417 Offset corrected by _R. J. Mathar_, Jul 13 2009 %E A162417 a(18) and further terms from _Robert G. Wilson v_, Aug 17 2009 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE