OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
a(19) = 6 because sqrt(19*6) rounded to the nearest integer is 11, which is prime. Any multiple smaller than this only rounds to a composite number.
MATHEMATICA
Array[(k = 1; While[! PrimeQ[Round@ Sqrt[k #]], k++]; k) &, 105] (* Michael De Vlieger, Oct 19 2022 *)
PROG
(PARI) a(n) = my(k=1); while (!isprime(round(sqrt(k*n))), k++); k; \\ Michel Marcus, Oct 18 2022
(Python)
from math import isqrt
from itertools import count
from sympy import isprime
def A357477(n): return next(filter(lambda k:isprime((m:=isqrt(k*n))+ int((k*n-m*(m+1)<<2)>=1)), count(1))) # Chai Wah Wu, Oct 19 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jake M. Gotlieb, Sep 30 2022
STATUS
approved