# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a185052 Showing 1-1 of 1 %I A185052 #14 Aug 04 2019 14:55:39 %S A185052 2,5,41,151,919,1787,5227,8147,17491,44207,57719,117133,176611,213659, %T A185052 304981,493159,757331,865363,1259429,1588231,1774901,2434381,2966141, %U A185052 3921383,5533067,6503771,7034429,8192473,8822377,10190473,16259017,18406229,22017199 %N A185052 Nearest prime to (prime(n)/2)^4. %C A185052 Nearest prime program by Ignacio Grande in LinkedIn Mathematica users group as answer to my question. %H A185052 Robert Israel, Table of n, a(n) for n = 1..10000 %p A185052 f:= proc(n) local x,q,r,v; %p A185052 x:= (ithprime(n)/2)^4; %p A185052 q:= nextprime(floor(x)); %p A185052 r:= prevprime(ceil(x)); %p A185052 v:= (q+r)/2; %p A185052 if v > x then r else q fi %p A185052 end proc: %p A185052 f(1):= 2: %p A185052 map(f, [$1..50]); # _Robert Israel_, Aug 04 2019 %t A185052 nearestPrime[n_Integer] := Module[{n2}, n2 = (Prime[n]/2)^4; %t A185052 If[n2 < 2, {2}, Nearest[Prime[PrimePi[n2] + {0, 1}], n2, 1]][[1]]]; nearestPrime /@ Range[20] %Y A185052 Cf. A186732. %K A185052 nonn,easy %O A185052 1,1 %A A185052 _Roger L. Bagula_, Jan 22 2012 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE