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

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60, we have over 367,000 sequences, and we’ve crossed 11,000 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A248170 Nonnegative integer whose square is the closest square to prime(n). 2
 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS Zak Seidov, Table of n, a(n) for n = 1..1000 FORMULA a(n) = sqrt(A246934(n)). MATHEMATICA ns[n_]:=Module[{s=Sqrt[n], a, b}, a=Floor[s]; b=Ceiling[s]; If[n-a^2<= b^2- n, a, b]]; ns/@Prime[Range[80]] Sqrt[#]&/@With[{s=Range[20]^2}, Table[Nearest[s, p], {p, Prime[ Range[ PrimePi[ Max[s]]]]-1}]]//Flatten (* Harvey P. Dale, May 14 2020 *) PROG (PARI) {forprime (p = 2, 400, a = sqrtint (p); b = (a + 1)^2; a = a^2; s = if (b - p > p - a, a, b); print1 (sqrtint (s) ", "))} CROSSREFS Cf. A000040, A246934. Sequence in context: A000006 A061017 A331535 * A225545 A088462 A189574 Adjacent sequences: A248167 A248168 A248169 * A248171 A248172 A248173 KEYWORD nonn AUTHOR Zak Seidov, Oct 03 2014 STATUS approved

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

Last modified December 1 23:26 EST 2023. Contains 367503 sequences. (Running on oeis4.)