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!)
A246934 The closest square to n-th prime. 2
1, 4, 4, 9, 9, 16, 16, 16, 25, 25, 36, 36, 36, 49, 49, 49, 64, 64, 64, 64, 81, 81, 81, 81, 100, 100, 100, 100, 100, 121, 121, 121, 144, 144, 144, 144, 169, 169, 169, 169, 169, 169, 196, 196, 196, 196, 225, 225, 225, 225, 225, 225, 256, 256, 256, 256, 256, 256, 289, 289, 289, 289 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(5) = 9 because 5th prime is 11, and 11-9<16-11, that is 9 is the closest square to 11.
PROG
(PARI){forprime (p = 2, 300, a = sqrtint (p); b = (a + 1)^2; a = a^2;
s = if (b - p > p - a, a, b); print1 (s ", "))}
CROSSREFS
Sequence in context: A162564 A014694 A065730 * A206919 A168039 A145445
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 02 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 July 18 21:02 EDT 2024. Contains 374388 sequences. (Running on oeis4.)