cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A103961 Least k such that 2*n*k - 1 is a prime.

This page as a plain text file.
%I A103961 #18 Nov 13 2020 19:08:18
%S A103961 2,1,1,1,2,1,1,2,1,1,2,1,4,3,1,1,2,2,1,2,1,1,3,1,3,2,1,3,3,1,1,2,2,1,
%T A103961 2,1,1,2,3,1,2,1,3,3,1,4,3,2,1,2,1,1,2,1,1,2,1,3,3,2,4,5,2,1,3,1,3,2,
%U A103961 1,1,2,3,7,3,1,1,2,2,1,3,4,1,2,1,3,5,1,7,8,1,1,2,3,3,2,1,1,3,1,1,5,5,3,5,2
%N A103961 Least k such that 2*n*k - 1 is a prime.
%C A103961 Question: Is the sequence unbounded (like A016014)? - _Dmitry Kamenetsky_, Oct 26 2016
%C A103961 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
%H A103961 Dmitry Kamenetsky, <a href="/A103961/b103961.txt">Table of n, a(n) for n = 1..10000</a>
%e A103961 2*1*2-1 = 3, so a(1) = 2;
%e A103961 2*5*2-1 = 19, so a(5) = 2.
%t A103961 Do[k = 1; cp = n*k - 1; While[ ! PrimeQ[cp], k++; cp = n*k - 1]; Print[k], {n, 2, 400, 2}]
%t A103961 lkp[n_]:=Module[{k=1},While[!PrimeQ[2n*k-1],k++];k]; Array[lkp,120] (* _Harvey P. Dale_, Nov 13 2020 *)
%o A103961 (PARI) a(n) = {my(k=1); while (!isprime(2*n*k-1), k++); k;} \\ _Michel Marcus_, Oct 27 2016
%Y A103961 Cf. A016014.
%K A103961 easy,nonn
%O A103961 1,1
%A A103961 _Lei Zhou_, Feb 23 2005