|
|
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|