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!)
A103689 a(n) is the least k such that either k*n - 1 or k*n + 1 (or both) is prime. 6
1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 4, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 6, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 6, 1, 6, 1, 2, 2, 2, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 6, 2, 2, 1, 2, 1, 2, 3, 4, 3, 2, 1, 2, 1, 2, 1, 6, 1, 6, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
LINKS
FORMULA
a(n) <= A200996(n). - Reinhard Zumkeller, Feb 14 2013
a(n) = min {A053989(n), A034693(n)}. - Reinhard Zumkeller, Feb 14 2013
a(A002110(n)/3+3) >= ceiling((prime(n+1)-1)/3) for n >= 2. Equality holds for n = 2, 4, 6, 8, 10, 12, 22, 25, 31, 116, 155, 156, 197, ... . - Pontus von Brömssen, Oct 16 2021
a(A002110(n)/3-3) >= ceiling((prime(n+1)-1)/3) for n >= 3. Equality holds for n = 3, 4, 5, 6, 7, 9, 39, 51, 59, 65, 98, 311, ... . - Pontus von Brömssen, Oct 19 2021
MATHEMATICA
f[n_] := Block[{k = 1}, While[ ! PrimeQ[k*n - 1] && ! PrimeQ[k*n + 1], k++ ]; k]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Feb 12 2005 *)
lk[n_]:=Module[{k=1}, While[NoneTrue[k*n+{1, -1}, PrimeQ], k++]; k]; Array[ lk, 120] (* The program uses the NoneTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 01 2016 *)
PROG
(Haskell)
a103689 n = min (a053989 n) (a034693 n)
-- Reinhard Zumkeller, Feb 14 2013
(PARI) a(n) = my(k=1); while (!isprime(k*n+1) && !isprime(k*n-1), k++); k; \\ Michel Marcus, Oct 18 2021
CROSSREFS
Sequence in context: A247976 A280986 A344773 * A245039 A161313 A161247
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Feb 12 2005
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Feb 19 2005
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 March 28 12:26 EDT 2024. Contains 371254 sequences. (Running on oeis4.)