login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A016014 Least k such that 2*n*k + 1 is a prime. 20
1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 3, 3, 1, 5, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 5, 3, 1, 2, 1, 1, 2, 3, 1, 3, 1, 4, 2, 1, 2, 3, 3, 1, 2, 1, 1, 3, 1, 1, 3, 1, 2, 2, 6, 2, 3, 3, 1, 2, 1, 3, 2, 1, 1, 2, 4, 3, 2, 1, 1, 3, 3, 1, 2, 4, 1, 5, 1, 2, 6, 1, 2, 2, 1, 1, 3, 7, 2, 5, 1, 1, 2, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
Is the sequence bounded? - Zak Seidov, Mar 25 2014
Answer: No, for any given N a number n such that a(n) > N can be constructed by the Chinese Remainder Theorem, see A239727. - Charles R Greathouse IV, Mar 25 2014
a(n) = 1 for n in A005097. - Robert Israel, Oct 26 2016
LINKS
MAPLE
f:= proc(n) local k;
for k from 1 do if isprime(2*n*k+1) then return k fi od
end proc:
map(f, [$1..100]); # Robert Israel, Oct 26 2016
MATHEMATICA
Do[k = 1; cp = n*k + 1; While[ ! PrimeQ[cp], k++; cp = n*k + 1]; Print[k], {n, 2, 400, 2}] (* Lei Zhou, Feb 23 2005 *)
lk[n_]:=Module[{k=1}, While[!PrimeQ[2n k+1], k++]; k]; Array[lk, 100] (* Harvey P. Dale, Apr 23 2023 *)
PROG
(PARI) a(n)=my(k); while(!isprime(2*n*(k++)+1), ); k \\ Charles R Greathouse IV, Mar 25 2014
(Python)
from sympy import isprime
def a(n):
k = 1
while not isprime(2*n*k + 1): k += 1
return k
print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Mar 28 2022
CROSSREFS
A070846 contains the corresponding primes.
Records are in A239746 with indices in A239727.
Sequence in context: A319135 A338884 A204901 * A067760 A078680 A296072
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 18:51 EDT 2024. Contains 371750 sequences. (Running on oeis4.)