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!)
A357899 Let k be the smallest k such that the square root of k*n rounds to a prime number; a(n) is this prime number. 1
2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 5, 7, 7, 7, 11, 11, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 11, 11, 11, 13, 13, 13, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 23, 23, 17, 17, 17, 17, 17, 17, 17, 17 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
This sequence gives the prime numbers associated with A357477.
The sequence is well defined as for any prime number p >= n/2, A000194 contains n or more consecutive p's, and so a(n) <= p.
LINKS
FORMULA
a(n) = round(sqrt(A357477(n) * n)).
EXAMPLE
For n = 19:
- we have:
k round(sqrt(k*19)) prime?
- ----------------- ------
1 4 No
2 6 No
3 8 No
4 9 No
5 10 No
6 11 Yes
- so a(19) = 11.
PROG
(PARI) a(n) = my (p); for (k=1, oo, if (isprime(p=round(sqrt(k*n))), return (p)))
(Python)
from math import isqrt
from itertools import count
from sympy import isprime
def A357899(n): return next(filter(isprime, ((m:=isqrt(k*n))+ int((k*n-m*(m+1)<<2)>=1) for k in count(1)))) # Chai Wah Wu, Oct 19 2022
CROSSREFS
Cf. A000194, A308052, A357477 (corresponding k's).
Sequence in context: A279757 A251550 A279221 * A247781 A004052 A051742
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Oct 19 2022
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 25 11:24 EDT 2024. Contains 371967 sequences. (Running on oeis4.)