OFFSET
1,2
COMMENTS
Smallest k such that A103689(k) = n.
a(85) > 10^9 (unless a(85) = 0).
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..84
EXAMPLE
a(3) = 92 because none of 92 +- 1 and 2*92 +- 1 are prime but 3*92 + 1 is prime; and for k < 92, either 3*k +- 1 are also both not prime, or some j*k +- 1 is prime for j < 3.
PROG
(Python)
from sympy import isprime
def A348347(n):
k = 1
while 1:
m = 1
while m <= n and not (isprime(m*k-1) or isprime(m*k+1)): m += 1
if m == n: return k
k += 1
(PARI) f(n) = my(k=1); while (!isprime(k*n+1) && !isprime(k*n-1), k++); k; \\ A103689
a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, Oct 18 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Pontus von Brömssen, Oct 13 2021
STATUS
approved