login
A231734
Least k such that n*k^2 - 1 is a prime, or 0 if no such k exists.
5
2, 2, 1, 1, 2, 1, 6, 1, 0, 3, 2, 1, 6, 1, 2, 0, 2, 1, 6, 1, 2, 3, 4, 1, 0, 2, 2, 3, 4, 1, 12, 1, 2, 6, 2, 0, 18, 1, 14, 3, 2, 1, 18, 1, 2, 27, 4, 1, 0, 2, 10, 3, 2, 1, 6, 2, 2, 3, 20, 1, 12, 1, 2, 0, 4, 2, 6, 1, 4, 9, 2, 1, 30, 1, 6, 3, 2, 2, 6, 1, 0, 12, 2, 1, 12, 3, 2
OFFSET
1,1
LINKS
EXAMPLE
a(9)=0 because 9*k^2-1 is never a prime: (3k-1)*(3k+1).
PROG
(PARI) a(n) = if (issquare(n) && (n>=9), 0, my(k=1); while (!isprime(n*k^2 - 1), k++); k); \\ Michel Marcus, Aug 20 2019
CROSSREFS
Sequence in context: A358525 A209332 A020945 * A231735 A016429 A131852
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Nov 12 2013
STATUS
approved