OFFSET
1,1
COMMENTS
Question: Is the sequence unbounded (like A016014)? - Dmitry Kamenetsky, Oct 26 2016
Answer: Yes. Essentially the same argument works. To get n such that a(n) > K, take distinct odd primes p_k, k=1..K with p_k not dividing k, and take n such that n == (2*k)^(-1) mod p_k and 2*k*n-1 > p_k for k=1..K. - Robert Israel, Oct 27 2016
LINKS
Dmitry Kamenetsky, Table of n, a(n) for n = 1..10000
EXAMPLE
2*1*2-1 = 3, so a(1) = 2;
2*5*2-1 = 19, so a(5) = 2.
MATHEMATICA
Do[k = 1; cp = n*k - 1; While[ ! PrimeQ[cp], k++; cp = n*k - 1]; Print[k], {n, 2, 400, 2}]
lkp[n_]:=Module[{k=1}, While[!PrimeQ[2n*k-1], k++]; k]; Array[lkp, 120] (* Harvey P. Dale, Nov 13 2020 *)
PROG
(PARI) a(n) = {my(k=1); while (!isprime(2*n*k-1), k++); k; } \\ Michel Marcus, Oct 27 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Lei Zhou, Feb 23 2005
STATUS
approved