login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181758 Greatest prime closest to n^3. 1
2, 7, 29, 67, 127, 211, 347, 509, 727, 997, 1327, 1733, 2203, 2741, 3373, 4099, 4909, 5827, 6857, 7993, 9257, 10651, 12163, 13829, 15629, 17579, 19681, 21961, 24391, 26993, 29789, 32771, 35933, 39301, 42863, 46663, 50651, 54869, 59333, 63997, 68917, 74093, 79493, 85193, 91127, 97327, 103813, 110597, 117643, 125003
(list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
29 is the greatest prime closest to 3^3 = 27.
MATHEMATICA
f3[n_]:=Module[{n3=n^3, np1, np2}, np1=NextPrime[n3, -1]; np2=NextPrime[n3]; If[(n3-np1)<(np2-n3), np1, np2]];
Table[f3[i], {i, 50}]
PROG
(PARI) a(n) = {if(n == 1, return(1)); my(n3 = n^3, gp = nextprime(n^3), lp = precprime(n^3)); if(n3 - lp < gp - n3, return(lp) , return(gp) ) } \\ David A. Corneth, May 25 2021
CROSSREFS
Cf. A113426.
Sequence in context: A274682 A359633 A339868 * A285790 A083016 A062064
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 20:35 EDT 2024. Contains 376002 sequences. (Running on oeis4.)