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

 

Logo
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
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
Sequence in context: A000006 A061017 A331535 * A225545 A088462 A189574
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 05:37 EDT 2024. Contains 371906 sequences. (Running on oeis4.)