A231776 Least positive integer k <= n with (2^k + k) * n - 1 prime, or 0 if such a number k does not exist.
1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 6, 2, 10, 1, 2, 1, 2, 1, 2, 1, 4, 2, 2, 1, 2, 8, 6, 1, 2, 1, 4, 2, 2, 1, 8, 1, 4, 1, 2, 2, 14, 2, 2, 1, 2, 1, 2, 6, 2, 1, 4, 2, 2, 3, 8, 1, 6, 1, 2, 1, 8, 5, 4, 1, 2, 1, 2, 6, 42, 2, 6, 2, 4, 2, 2, 1, 2, 1, 4, 1, 4, 2, 8, 1, 2, 1, 2, 1, 6, 1, 8, 20, 2, 1, 2, 6, 10, 1, 2, 2
Offset: 1
Keywords
Examples
a(3) = 2 since (2^1 + 1) * 3 - 1 = 8 is not prime, but (2^2 + 2) * 3 - 1 = 17 is prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Do[Do[If[PrimeQ[(2^k+k)*n-1],Print[n," ",k];Goto[aa]],{k,1,n}]; Print[n," ",0];Label[aa];Continue,{n,1,100}] lpi[n_]:=Module[{k=1},While[!PrimeQ[n(2^k+k)-1],k++];k]; Array[lpi,100] (* Harvey P. Dale, Aug 10 2019 *)
Comments